<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE BangPatterns, CPP, ScopedTypeVariables, MagicHash #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-4"></span><span class="hs-comment">--</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- GHC Interactive support for inspecting arbitrary closures at runtime</span><span>
</span><span id="line-6"></span><span class="hs-comment">--</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Pepe Iborra (supported by Google SoC) 2006</span><span>
</span><span id="line-8"></span><span class="hs-comment">--</span><span>
</span><span id="line-9"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-10"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Runtime.Heap.Inspect</span><span class="hs-special">(</span><span>
</span><span id="line-11"></span><span>     </span><span class="annot"><span class="hs-comment">-- * Entry points and types</span></span><span>
</span><span id="line-12"></span><span>     </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#cvObtainTerm"><span class="hs-identifier">cvObtainTerm</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-13"></span><span>     </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#cvReconstructType"><span class="hs-identifier">cvReconstructType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-14"></span><span>     </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#improveRTTIType"><span class="hs-identifier">improveRTTIType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>     </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier">Term</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span>     </span><span class="annot"><span class="hs-comment">-- * Utils</span></span><span>
</span><span id="line-18"></span><span>     </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#isFullyEvaluatedTerm"><span class="hs-identifier">isFullyEvaluatedTerm</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>     </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#termType"><span class="hs-identifier">termType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#mapTermType"><span class="hs-identifier">mapTermType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#termTyCoVars"><span class="hs-identifier">termTyCoVars</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>     </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#foldTerm"><span class="hs-identifier">foldTerm</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermFold"><span class="hs-identifier">TermFold</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>     </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#cPprTerm"><span class="hs-identifier">cPprTerm</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#cPprTermBase"><span class="hs-identifier">cPprTermBase</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span>     </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#constrClosToName"><span class="hs-identifier">constrClosToName</span></a></span><span> </span><span class="hs-comment">-- exported to use in test T4891</span><span>
</span><span id="line-24"></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Interpreter.html"><span class="hs-identifier">GHC.Runtime.Interpreter</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">GHCi</span></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#"><span class="hs-identifier">GHCi.RemoteTypes</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#"><span class="hs-identifier">GHCi.Message</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#fromSerializableException"><span class="hs-identifier">fromSerializableException</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-35"></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html"><span class="hs-identifier">GHC.Types.RepType</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Multiplicity.html"><span class="hs-identifier">GHC.Core.Multiplicity</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Core.Unify.html"><span class="hs-identifier">GHC.Core.Unify</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">U</span></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html"><span class="hs-identifier">GHC.Tc.Utils.TcType</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcMType.html"><span class="hs-identifier">GHC.Tc.Utils.TcMType</span></a></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html"><span class="hs-identifier">GHC.Tc.Utils.Zonk</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html#zonkTcTypeToTypeX"><span class="hs-identifier">zonkTcTypeToTypeX</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html#mkEmptyZonkEnv"><span class="hs-identifier">mkEmptyZonkEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html#ZonkFlexi"><span class="hs-identifier">ZonkFlexi</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html#RuntimeUnkFlexi"><span class="hs-identifier">RuntimeUnkFlexi</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Unify.html"><span class="hs-identifier">GHC.Tc.Utils.Unify</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html"><span class="hs-identifier">GHC.Tc.Utils.Env</span></a></span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html"><span class="hs-identifier">GHC.Types.Name.Occurrence</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">OccName</span></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html"><span class="hs-identifier">GHC.Iface.Env</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html"><span class="hs-identifier">GHC.Types.Var.Set</span></a></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Boxity"><span class="hs-identifier">Boxity</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.Prim.html"><span class="hs-identifier">GHC.Builtin.Types.Prim</span></a></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Ppr</span></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Char.html#"><span class="hs-identifier">GHC.Char</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.html#"><span class="hs-identifier">GHC.Exts.Heap</span></a></span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html"><span class="hs-identifier">GHC.Runtime.Heap.Layout</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#roundUpTo"><span class="hs-identifier">roundUpTo</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#"><span class="hs-identifier">GHC.IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier">throwIO</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#"><span class="hs-identifier">Data.Maybe</span></a></span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exts.html#"><span class="hs-identifier">GHC.Exts</span></a></span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Sequence.html#"><span class="hs-identifier">Data.Sequence</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Seq</span></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../containers/src/Data.Sequence.html#"><span class="hs-identifier">Data.Sequence</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Sequence.Internal.html#viewl"><span class="hs-identifier">viewl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../containers/src/Data.Sequence.Internal.html#ViewL"><span class="hs-identifier">ViewL</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Foreign.html#"><span class="hs-identifier">Foreign</span></a></span><span>
</span><span id="line-73"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.Unsafe.html#"><span class="hs-identifier">System.IO.Unsafe</span></a></span><span>
</span><span id="line-74"></span><span>
</span><span id="line-75"></span><span class="hs-comment">---------------------------------------------</span><span>
</span><span id="line-76"></span><span class="hs-comment">-- * A representation of semi evaluated Terms</span><span>
</span><span id="line-77"></span><span class="hs-comment">---------------------------------------------</span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span class="hs-keyword">data</span><span> </span><span id="Term"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-var">Term</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Term"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-var">Term</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="ty"><span class="annot"><span class="annottext">Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var hs-var">ty</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span>
</span><span id="line-80"></span><span>                 </span><span class="hs-special">,</span><span> </span><span id="dc"><span class="annot"><span class="annottext">Term -&gt; Either String DataCon
</span><a href="GHC.Runtime.Heap.Inspect.html#dc"><span class="hs-identifier hs-var hs-var">dc</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>
</span><span id="line-81"></span><span>                               </span><span class="hs-comment">-- Carries a text representation if the datacon is</span><span>
</span><span id="line-82"></span><span>                               </span><span class="hs-comment">-- not exported by the .hi file, which is the case</span><span>
</span><span id="line-83"></span><span>                               </span><span class="hs-comment">-- for private constructors in -O0 compiled libraries</span><span>
</span><span id="line-84"></span><span>                 </span><span class="hs-special">,</span><span> </span><span id="val"><span class="annot"><span class="annottext">Term -&gt; ForeignHValue
</span><a href="GHC.Runtime.Heap.Inspect.html#val"><span class="hs-identifier hs-var hs-var">val</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span>
</span><span id="line-85"></span><span>                 </span><span class="hs-special">,</span><span> </span><span id="subTerms"><span class="annot"><span class="annottext">Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var hs-var">subTerms</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span id="Prim"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-var">Prim</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="ty"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var">ty</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span>
</span><span id="line-88"></span><span>                 </span><span class="hs-special">,</span><span> </span><span id="valRaw"><span class="annot"><span class="annottext">Term -&gt; [Word]
</span><a href="GHC.Runtime.Heap.Inspect.html#valRaw"><span class="hs-identifier hs-var hs-var">valRaw</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Word</span></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span id="Suspension"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-var">Suspension</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="ctype"><span class="annot"><span class="annottext">Term -&gt; ClosureType
</span><a href="GHC.Runtime.Heap.Inspect.html#ctype"><span class="hs-identifier hs-var hs-var">ctype</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.ClosureTypes.html#ClosureType"><span class="hs-identifier hs-type">ClosureType</span></a></span><span>
</span><span id="line-91"></span><span>                       </span><span class="hs-special">,</span><span> </span><span id="ty"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var">ty</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span>
</span><span id="line-92"></span><span>                       </span><span class="hs-special">,</span><span> </span><span id="val"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#val"><span class="hs-identifier hs-var">val</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span>
</span><span id="line-93"></span><span>                       </span><span class="hs-special">,</span><span> </span><span id="bound_to"><span class="annot"><span class="annottext">Term -&gt; Maybe Name
</span><a href="GHC.Runtime.Heap.Inspect.html#bound_to"><span class="hs-identifier hs-var hs-var">bound_to</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>   </span><span class="hs-comment">-- Useful for printing</span><span>
</span><span id="line-94"></span><span>                       </span><span class="hs-special">}</span><span>
</span><span id="line-95"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span id="NewtypeWrap"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#NewtypeWrap"><span class="hs-identifier hs-var">NewtypeWrap</span></a></span></span><span class="hs-special">{</span><span>       </span><span class="hs-comment">-- At runtime there are no newtypes, and hence no</span><span>
</span><span id="line-96"></span><span>                               </span><span class="hs-comment">-- newtype constructors. A NewtypeWrap is just a</span><span>
</span><span id="line-97"></span><span>                               </span><span class="hs-comment">-- made-up tag saying &quot;heads up, there used to be</span><span>
</span><span id="line-98"></span><span>                               </span><span class="hs-comment">-- a newtype constructor here&quot;.</span><span>
</span><span id="line-99"></span><span>                         </span><span id="ty"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var">ty</span></a></span></span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span>
</span><span id="line-100"></span><span>                       </span><span class="hs-special">,</span><span> </span><span id="dc"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#dc"><span class="hs-identifier hs-var">dc</span></a></span></span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>
</span><span id="line-101"></span><span>                       </span><span class="hs-special">,</span><span> </span><span id="wrapped_term"><span class="annot"><span class="annottext">Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#wrapped_term"><span class="hs-identifier hs-var hs-var">wrapped_term</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-102"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span id="RefWrap"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RefWrap"><span class="hs-identifier hs-var">RefWrap</span></a></span></span><span>    </span><span class="hs-special">{</span><span>       </span><span class="hs-comment">-- The contents of a reference</span><span>
</span><span id="line-103"></span><span>                         </span><span id="ty"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var">ty</span></a></span></span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span>
</span><span id="line-104"></span><span>                       </span><span class="hs-special">,</span><span> </span><span id="wrapped_term"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#wrapped_term"><span class="hs-identifier hs-var">wrapped_term</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#termType"><span class="hs-identifier hs-type">termType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span>
</span><span id="line-107"></span><span id="termType"><span class="annot"><span class="annottext">termType :: Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#termType"><span class="hs-identifier hs-var hs-var">termType</span></a></span></span><span> </span><span id="local-6989586621681198116"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198116"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198116"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-108"></span><span>
</span><span id="line-109"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#isFullyEvaluatedTerm"><span class="hs-identifier hs-type">isFullyEvaluatedTerm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-110"></span><span id="isFullyEvaluatedTerm"><span class="annot"><span class="annottext">isFullyEvaluatedTerm :: Term -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isFullyEvaluatedTerm"><span class="hs-identifier hs-var hs-var">isFullyEvaluatedTerm</span></a></span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681198115"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681198115"><span class="hs-identifier hs-var">tt</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; Bool) -&gt; [Term] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isFullyEvaluatedTerm"><span class="hs-identifier hs-var">isFullyEvaluatedTerm</span></a></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681198115"><span class="hs-identifier hs-var">tt</span></a></span><span>
</span><span id="line-111"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#isFullyEvaluatedTerm"><span class="hs-identifier hs-var">isFullyEvaluatedTerm</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-type">Prim</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-112"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#isFullyEvaluatedTerm"><span class="hs-identifier hs-var">isFullyEvaluatedTerm</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#NewtypeWrap"><span class="hs-identifier hs-type">NewtypeWrap</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">wrapped_term :: Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#wrapped_term"><span class="hs-identifier hs-var">wrapped_term</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681198113"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198113"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Term -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isFullyEvaluatedTerm"><span class="hs-identifier hs-var">isFullyEvaluatedTerm</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198113"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-113"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#isFullyEvaluatedTerm"><span class="hs-identifier hs-var">isFullyEvaluatedTerm</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RefWrap"><span class="hs-identifier hs-type">RefWrap</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">wrapped_term :: Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#wrapped_term"><span class="hs-identifier hs-var">wrapped_term</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681198112"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198112"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">}</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Term -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isFullyEvaluatedTerm"><span class="hs-identifier hs-var">isFullyEvaluatedTerm</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198112"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-114"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#isFullyEvaluatedTerm"><span class="hs-identifier hs-var">isFullyEvaluatedTerm</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><span class="hs-identifier">_</span></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681198109"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-117"></span><span> </span><span id="local-6989586621681198104"><span class="annot"><span class="annottext">ppr :: Term -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span id="local-6989586621681198102"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198102"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681198101"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681198101"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CustomTermPrinter Maybe -&gt; Term -&gt; Maybe SDoc
forall (m :: * -&gt; *).
Monad m =&gt;
CustomTermPrinter m -&gt; Term -&gt; m SDoc
</span><a href="GHC.Runtime.Heap.Inspect.html#cPprTerm"><span class="hs-identifier hs-var">cPprTerm</span></a></span><span> </span><span class="annot"><span class="annottext">CustomTermPrinter Maybe
forall (m :: * -&gt; *). Monad m =&gt; CustomTermPrinter m
</span><a href="GHC.Runtime.Heap.Inspect.html#cPprTermBase"><span class="hs-identifier hs-var">cPprTermBase</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198102"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681198101"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-118"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Outputable Term instance&quot;</span></span><span>
</span><span id="line-119"></span><span>
</span><span id="line-120"></span><span class="hs-comment">----------------------------------------</span><span>
</span><span id="line-121"></span><span class="hs-comment">-- Runtime Closure information functions</span><span>
</span><span id="line-122"></span><span class="hs-comment">----------------------------------------</span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span id="local-6989586621681198639"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#isThunk"><span class="hs-identifier hs-type">isThunk</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#GenClosure"><span class="hs-identifier hs-type">GenClosure</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198639"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-125"></span><span id="isThunk"><span class="annot"><span class="annottext">isThunk :: forall a. GenClosure a -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isThunk"><span class="hs-identifier hs-var hs-var">isThunk</span></a></span></span><span> </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#ThunkClosure"><span class="hs-identifier hs-type">ThunkClosure</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-126"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#isThunk"><span class="hs-identifier hs-var">isThunk</span></a></span><span> </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#APClosure"><span class="hs-identifier hs-type">APClosure</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-127"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#isThunk"><span class="hs-identifier hs-var">isThunk</span></a></span><span> </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#APStackClosure"><span class="hs-identifier hs-type">APStackClosure</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-128"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#isThunk"><span class="hs-identifier hs-var">isThunk</span></a></span><span> </span><span class="annot"><span class="annottext">GenClosure a
</span><span class="hs-identifier">_</span></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-129"></span><span>
</span><span id="line-130"></span><span class="hs-comment">-- Lookup the name in a constructor closure</span><span>
</span><span id="line-131"></span><span id="local-6989586621681198636"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#constrClosToName"><span class="hs-identifier hs-type">constrClosToName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#GenClosure"><span class="hs-identifier hs-type">GenClosure</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198636"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-132"></span><span id="constrClosToName"><span class="annot"><span class="annottext">constrClosToName :: forall a. HscEnv -&gt; GenClosure a -&gt; IO (Either String Name)
</span><a href="GHC.Runtime.Heap.Inspect.html#constrClosToName"><span class="hs-identifier hs-var hs-var">constrClosToName</span></a></span></span><span> </span><span id="local-6989586621681198089"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198089"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#ConstrClosure"><span class="hs-identifier hs-type">ConstrClosure</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">pkg :: forall b. GenClosure b -&gt; String
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#pkg"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681198086"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681198086"><span class="hs-identifier hs-var">pkg</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">modl :: forall b. GenClosure b -&gt; String
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#modl"><span class="hs-identifier hs-var">modl</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681198084"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681198084"><span class="hs-identifier hs-var">mod</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">name :: forall b. GenClosure b -&gt; String
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#name"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681198082"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681198082"><span class="hs-identifier hs-var">occ</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-133"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681198081"><span class="annot"><span class="annottext">occName :: OccName
</span><a href="#local-6989586621681198081"><span class="hs-identifier hs-var hs-var">occName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameSpace -&gt; String -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkOccName"><span class="hs-identifier hs-var">mkOccName</span></a></span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#dataName"><span class="hs-identifier hs-var">OccName.dataName</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681198082"><span class="hs-identifier hs-var">occ</span></a></span><span>
</span><span id="line-134"></span><span>       </span><span id="local-6989586621681198078"><span class="annot"><span class="annottext">modName :: GenModule Unit
</span><a href="#local-6989586621681198078"><span class="hs-identifier hs-var hs-var">modName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unit -&gt; ModuleName -&gt; GenModule Unit
forall u. u -&gt; ModuleName -&gt; GenModule u
</span><a href="GHC.Unit.Types.html#mkModule"><span class="hs-identifier hs-var">mkModule</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Unit
</span><a href="GHC.Unit.Types.html#stringToUnit"><span class="hs-identifier hs-var">stringToUnit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681198086"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; ModuleName
</span><a href="GHC.Unit.Module.Name.html#mkModuleName"><span class="hs-identifier hs-var">mkModuleName</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681198084"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-135"></span><span>   </span><span class="annot"><span class="annottext">Name -&gt; Either String Name
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Either String Name) -&gt; IO Name -&gt; IO (Either String Name)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-operator hs-var">`fmap`</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; GenModule Unit -&gt; OccName -&gt; IO Name
</span><a href="GHC.Iface.Env.html#lookupOrigIO"><span class="hs-identifier hs-var">lookupOrigIO</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198089"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621681198078"><span class="hs-identifier hs-var">modName</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681198081"><span class="hs-identifier hs-var">occName</span></a></span><span>
</span><span id="line-136"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#constrClosToName"><span class="hs-identifier hs-var">constrClosToName</span></a></span><span> </span><span id="local-6989586621681198073"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198073"><span class="hs-identifier hs-var">_hsc_env</span></a></span></span><span> </span><span id="local-6989586621681198072"><span class="annot"><span class="annottext">GenClosure a
</span><a href="#local-6989586621681198072"><span class="hs-identifier hs-var">clos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-137"></span><span>   </span><span class="annot"><span class="annottext">Either String Name -&gt; IO (Either String Name)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Either String Name
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;conClosToName: Expected ConstrClosure, got &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">GenClosure () -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; ()) -&gt; GenClosure a -&gt; GenClosure ()
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; a -&gt; ()
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GenClosure a
</span><a href="#local-6989586621681198072"><span class="hs-identifier hs-var">clos</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-138"></span><span>
</span><span id="line-139"></span><span class="hs-comment">-----------------------------------</span><span>
</span><span id="line-140"></span><span class="hs-comment">-- * Traversals for Terms</span><span>
</span><span id="line-141"></span><span class="hs-comment">-----------------------------------</span><span>
</span><span id="line-142"></span><span class="hs-keyword">type</span><span> </span><span id="TermProcessor"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermProcessor"><span class="hs-identifier hs-var">TermProcessor</span></a></span></span><span> </span><span id="local-6989586621681198069"><span class="annot"><a href="#local-6989586621681198069"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span id="local-6989586621681198068"><span class="annot"><a href="#local-6989586621681198068"><span class="hs-identifier hs-type">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681198069"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198068"><span class="hs-identifier hs-type">b</span></a></span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span class="hs-keyword">data</span><span> </span><span id="TermFold"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermFold"><span class="hs-identifier hs-var">TermFold</span></a></span></span><span> </span><span id="local-6989586621681198616"><span class="annot"><a href="#local-6989586621681198616"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="TermFold"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermFold"><span class="hs-identifier hs-var">TermFold</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="fTerm"><span class="annot"><span class="annottext">forall a. TermFold a -&gt; TermProcessor a a
</span><a href="GHC.Runtime.Heap.Inspect.html#fTerm"><span class="hs-identifier hs-var hs-var">fTerm</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermProcessor"><span class="hs-identifier hs-type">TermProcessor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198616"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198616"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-145"></span><span>                           </span><span class="hs-special">,</span><span> </span><span id="fPrim"><span class="annot"><span class="annottext">forall a. TermFold a -&gt; TcType -&gt; [Word] -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#fPrim"><span class="hs-identifier hs-var hs-var">fPrim</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Word</span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198616"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-146"></span><span>                           </span><span class="hs-special">,</span><span> </span><span id="fSuspension"><span class="annot"><span class="annottext">forall a.
TermFold a
-&gt; ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#fSuspension"><span class="hs-identifier hs-var hs-var">fSuspension</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.ClosureTypes.html#ClosureType"><span class="hs-identifier hs-type">ClosureType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span>
</span><span id="line-147"></span><span>                                            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198616"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-148"></span><span>                           </span><span class="hs-special">,</span><span> </span><span id="fNewtypeWrap"><span class="annot"><span class="annottext">forall a. TermFold a -&gt; TcType -&gt; Either String DataCon -&gt; a -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#fNewtypeWrap"><span class="hs-identifier hs-var hs-var">fNewtypeWrap</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>
</span><span id="line-149"></span><span>                                            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198616"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198616"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-150"></span><span>                           </span><span class="hs-special">,</span><span> </span><span id="fRefWrap"><span class="annot"><span class="annottext">forall a. TermFold a -&gt; TcType -&gt; a -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#fRefWrap"><span class="hs-identifier hs-var hs-var">fRefWrap</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198616"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198616"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-151"></span><span>                           </span><span class="hs-special">}</span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span>
</span><span id="line-154"></span><span class="hs-keyword">data</span><span> </span><span id="TermFoldM"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermFoldM"><span class="hs-identifier hs-var">TermFoldM</span></a></span></span><span> </span><span id="local-6989586621681198608"><span class="annot"><a href="#local-6989586621681198608"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span id="local-6989586621681198607"><span class="annot"><a href="#local-6989586621681198607"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-155"></span><span>                   </span><span id="TermFoldM"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermFoldM"><span class="hs-identifier hs-var">TermFoldM</span></a></span></span><span> </span><span class="hs-special">{</span><span id="fTermM"><span class="annot"><span class="annottext">forall (m :: * -&gt; *) a. TermFoldM m a -&gt; TermProcessor a (m a)
</span><a href="GHC.Runtime.Heap.Inspect.html#fTermM"><span class="hs-identifier hs-var hs-var">fTermM</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermProcessor"><span class="hs-identifier hs-type">TermProcessor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198607"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681198608"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198607"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-156"></span><span>                            </span><span class="hs-special">,</span><span> </span><span id="fPrimM"><span class="annot"><span class="annottext">forall (m :: * -&gt; *) a. TermFoldM m a -&gt; TcType -&gt; [Word] -&gt; m a
</span><a href="GHC.Runtime.Heap.Inspect.html#fPrimM"><span class="hs-identifier hs-var hs-var">fPrimM</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Word</span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198608"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198607"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-157"></span><span>                            </span><span class="hs-special">,</span><span> </span><span id="fSuspensionM"><span class="annot"><span class="annottext">forall (m :: * -&gt; *) a.
TermFoldM m a
-&gt; ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; m a
</span><a href="GHC.Runtime.Heap.Inspect.html#fSuspensionM"><span class="hs-identifier hs-var hs-var">fSuspensionM</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.ClosureTypes.html#ClosureType"><span class="hs-identifier hs-type">ClosureType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span>
</span><span id="line-158"></span><span>                                             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198608"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198607"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-159"></span><span>                            </span><span class="hs-special">,</span><span> </span><span id="fNewtypeWrapM"><span class="annot"><span class="annottext">forall (m :: * -&gt; *) a.
TermFoldM m a -&gt; TcType -&gt; Either String DataCon -&gt; a -&gt; m a
</span><a href="GHC.Runtime.Heap.Inspect.html#fNewtypeWrapM"><span class="hs-identifier hs-var hs-var">fNewtypeWrapM</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>
</span><span id="line-160"></span><span>                                            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198607"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198608"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198607"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-161"></span><span>                            </span><span class="hs-special">,</span><span> </span><span id="fRefWrapM"><span class="annot"><span class="annottext">forall (m :: * -&gt; *) a. TermFoldM m a -&gt; TcType -&gt; a -&gt; m a
</span><a href="GHC.Runtime.Heap.Inspect.html#fRefWrapM"><span class="hs-identifier hs-var hs-var">fRefWrapM</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198607"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198608"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198607"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-162"></span><span>                           </span><span class="hs-special">}</span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span id="local-6989586621681198595"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#foldTerm"><span class="hs-identifier hs-type">foldTerm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermFold"><span class="hs-identifier hs-type">TermFold</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198595"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198595"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-165"></span><span id="foldTerm"><span class="annot"><span class="annottext">foldTerm :: forall a. TermFold a -&gt; Term -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#foldTerm"><span class="hs-identifier hs-var hs-var">foldTerm</span></a></span></span><span> </span><span id="local-6989586621681198055"><span class="annot"><span class="annottext">TermFold a
</span><a href="#local-6989586621681198055"><span class="hs-identifier hs-var">tf</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span id="local-6989586621681198054"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198054"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681198053"><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681198053"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621681198052"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198052"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681198051"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681198051"><span class="hs-identifier hs-var">tt</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFold a -&gt; TermProcessor a a
forall a. TermFold a -&gt; TermProcessor a a
</span><a href="GHC.Runtime.Heap.Inspect.html#fTerm"><span class="hs-identifier hs-var hs-var">fTerm</span></a></span><span> </span><span class="annot"><span class="annottext">TermFold a
</span><a href="#local-6989586621681198055"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198054"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681198053"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198052"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Term -&gt; a) -&gt; [Term] -&gt; [a]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TermFold a -&gt; Term -&gt; a
forall a. TermFold a -&gt; Term -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#foldTerm"><span class="hs-identifier hs-var">foldTerm</span></a></span><span> </span><span class="annot"><span class="annottext">TermFold a
</span><a href="#local-6989586621681198055"><span class="hs-identifier hs-var">tf</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681198051"><span class="hs-identifier hs-var">tt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-166"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#foldTerm"><span class="hs-identifier hs-var">foldTerm</span></a></span><span> </span><span id="local-6989586621681198050"><span class="annot"><span class="annottext">TermFold a
</span><a href="#local-6989586621681198050"><span class="hs-identifier hs-var">tf</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-type">Prim</span></a></span><span> </span><span id="local-6989586621681198049"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198049"><span class="hs-identifier hs-var">ty</span></a></span></span><span>    </span><span id="local-6989586621681198048"><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681198048"><span class="hs-identifier hs-var">v</span></a></span></span><span>   </span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFold a -&gt; TcType -&gt; [Word] -&gt; a
forall a. TermFold a -&gt; TcType -&gt; [Word] -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#fPrim"><span class="hs-identifier hs-var hs-var">fPrim</span></a></span><span> </span><span class="annot"><span class="annottext">TermFold a
</span><a href="#local-6989586621681198050"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198049"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681198048"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-167"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#foldTerm"><span class="hs-identifier hs-var">foldTerm</span></a></span><span> </span><span id="local-6989586621681198047"><span class="annot"><span class="annottext">TermFold a
</span><a href="#local-6989586621681198047"><span class="hs-identifier hs-var">tf</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-type">Suspension</span></a></span><span> </span><span id="local-6989586621681198046"><span class="annot"><span class="annottext">ClosureType
</span><a href="#local-6989586621681198046"><span class="hs-identifier hs-var">ct</span></a></span></span><span> </span><span id="local-6989586621681198045"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198045"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681198044"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198044"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681198043"><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681198043"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFold a
-&gt; ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; a
forall a.
TermFold a
-&gt; ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#fSuspension"><span class="hs-identifier hs-var hs-var">fSuspension</span></a></span><span> </span><span class="annot"><span class="annottext">TermFold a
</span><a href="#local-6989586621681198047"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureType
</span><a href="#local-6989586621681198046"><span class="hs-identifier hs-var">ct</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198045"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198044"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681198043"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-168"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#foldTerm"><span class="hs-identifier hs-var">foldTerm</span></a></span><span> </span><span id="local-6989586621681198042"><span class="annot"><span class="annottext">TermFold a
</span><a href="#local-6989586621681198042"><span class="hs-identifier hs-var">tf</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#NewtypeWrap"><span class="hs-identifier hs-type">NewtypeWrap</span></a></span><span> </span><span id="local-6989586621681198041"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198041"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681198040"><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681198040"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621681198039"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198039"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFold a -&gt; TcType -&gt; Either String DataCon -&gt; a -&gt; a
forall a. TermFold a -&gt; TcType -&gt; Either String DataCon -&gt; a -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#fNewtypeWrap"><span class="hs-identifier hs-var hs-var">fNewtypeWrap</span></a></span><span> </span><span class="annot"><span class="annottext">TermFold a
</span><a href="#local-6989586621681198042"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198041"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681198040"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TermFold a -&gt; Term -&gt; a
forall a. TermFold a -&gt; Term -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#foldTerm"><span class="hs-identifier hs-var">foldTerm</span></a></span><span> </span><span class="annot"><span class="annottext">TermFold a
</span><a href="#local-6989586621681198042"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198039"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-169"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#foldTerm"><span class="hs-identifier hs-var">foldTerm</span></a></span><span> </span><span id="local-6989586621681198038"><span class="annot"><span class="annottext">TermFold a
</span><a href="#local-6989586621681198038"><span class="hs-identifier hs-var">tf</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RefWrap"><span class="hs-identifier hs-type">RefWrap</span></a></span><span> </span><span id="local-6989586621681198037"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198037"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681198036"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198036"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFold a -&gt; TcType -&gt; a -&gt; a
forall a. TermFold a -&gt; TcType -&gt; a -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#fRefWrap"><span class="hs-identifier hs-var hs-var">fRefWrap</span></a></span><span> </span><span class="annot"><span class="annottext">TermFold a
</span><a href="#local-6989586621681198038"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198037"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TermFold a -&gt; Term -&gt; a
forall a. TermFold a -&gt; Term -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#foldTerm"><span class="hs-identifier hs-var">foldTerm</span></a></span><span> </span><span class="annot"><span class="annottext">TermFold a
</span><a href="#local-6989586621681198038"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198036"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span id="local-6989586621681198590"><span id="local-6989586621681198591"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#foldTermM"><span class="hs-identifier hs-type">foldTermM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198591"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermFoldM"><span class="hs-identifier hs-type">TermFoldM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198591"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198590"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198591"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198590"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-173"></span><span id="foldTermM"><span class="annot"><span class="annottext">foldTermM :: forall (m :: * -&gt; *) a. Monad m =&gt; TermFoldM m a -&gt; Term -&gt; m a
</span><a href="GHC.Runtime.Heap.Inspect.html#foldTermM"><span class="hs-identifier hs-var hs-var">foldTermM</span></a></span></span><span> </span><span id="local-6989586621681198025"><span class="annot"><span class="annottext">TermFoldM m a
</span><a href="#local-6989586621681198025"><span class="hs-identifier hs-var">tf</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span id="local-6989586621681198024"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198024"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681198023"><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681198023"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621681198022"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198022"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681198021"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681198021"><span class="hs-identifier hs-var">tt</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; m a) -&gt; [Term] -&gt; m [a]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TermFoldM m a -&gt; Term -&gt; m a
forall (m :: * -&gt; *) a. Monad m =&gt; TermFoldM m a -&gt; Term -&gt; m a
</span><a href="GHC.Runtime.Heap.Inspect.html#foldTermM"><span class="hs-identifier hs-var">foldTermM</span></a></span><span> </span><span class="annot"><span class="annottext">TermFoldM m a
</span><a href="#local-6989586621681198025"><span class="hs-identifier hs-var">tf</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681198021"><span class="hs-identifier hs-var">tt</span></a></span><span> </span><span class="annot"><span class="annottext">m [a] -&gt; ([a] -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">TermFoldM m a -&gt; TermProcessor a (m a)
forall (m :: * -&gt; *) a. TermFoldM m a -&gt; TermProcessor a (m a)
</span><a href="GHC.Runtime.Heap.Inspect.html#fTermM"><span class="hs-identifier hs-var hs-var">fTermM</span></a></span><span> </span><span class="annot"><span class="annottext">TermFoldM m a
</span><a href="#local-6989586621681198025"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198024"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681198023"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198022"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-174"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#foldTermM"><span class="hs-identifier hs-var">foldTermM</span></a></span><span> </span><span id="local-6989586621681198019"><span class="annot"><span class="annottext">TermFoldM m a
</span><a href="#local-6989586621681198019"><span class="hs-identifier hs-var">tf</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-type">Prim</span></a></span><span> </span><span id="local-6989586621681198018"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198018"><span class="hs-identifier hs-var">ty</span></a></span></span><span>    </span><span id="local-6989586621681198017"><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681198017"><span class="hs-identifier hs-var">v</span></a></span></span><span>   </span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFoldM m a -&gt; TcType -&gt; [Word] -&gt; m a
forall (m :: * -&gt; *) a. TermFoldM m a -&gt; TcType -&gt; [Word] -&gt; m a
</span><a href="GHC.Runtime.Heap.Inspect.html#fPrimM"><span class="hs-identifier hs-var hs-var">fPrimM</span></a></span><span> </span><span class="annot"><span class="annottext">TermFoldM m a
</span><a href="#local-6989586621681198019"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198018"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681198017"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-175"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#foldTermM"><span class="hs-identifier hs-var">foldTermM</span></a></span><span> </span><span id="local-6989586621681198016"><span class="annot"><span class="annottext">TermFoldM m a
</span><a href="#local-6989586621681198016"><span class="hs-identifier hs-var">tf</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-type">Suspension</span></a></span><span> </span><span id="local-6989586621681198015"><span class="annot"><span class="annottext">ClosureType
</span><a href="#local-6989586621681198015"><span class="hs-identifier hs-var">ct</span></a></span></span><span> </span><span id="local-6989586621681198014"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198014"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681198013"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198013"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681198012"><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681198012"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFoldM m a
-&gt; ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; m a
forall (m :: * -&gt; *) a.
TermFoldM m a
-&gt; ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; m a
</span><a href="GHC.Runtime.Heap.Inspect.html#fSuspensionM"><span class="hs-identifier hs-var hs-var">fSuspensionM</span></a></span><span> </span><span class="annot"><span class="annottext">TermFoldM m a
</span><a href="#local-6989586621681198016"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureType
</span><a href="#local-6989586621681198015"><span class="hs-identifier hs-var">ct</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198014"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198013"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681198012"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-176"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#foldTermM"><span class="hs-identifier hs-var">foldTermM</span></a></span><span> </span><span id="local-6989586621681198011"><span class="annot"><span class="annottext">TermFoldM m a
</span><a href="#local-6989586621681198011"><span class="hs-identifier hs-var">tf</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#NewtypeWrap"><span class="hs-identifier hs-type">NewtypeWrap</span></a></span><span> </span><span id="local-6989586621681198010"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198010"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681198009"><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681198009"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621681198008"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198008"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFoldM m a -&gt; Term -&gt; m a
forall (m :: * -&gt; *) a. Monad m =&gt; TermFoldM m a -&gt; Term -&gt; m a
</span><a href="GHC.Runtime.Heap.Inspect.html#foldTermM"><span class="hs-identifier hs-var">foldTermM</span></a></span><span> </span><span class="annot"><span class="annottext">TermFoldM m a
</span><a href="#local-6989586621681198011"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198008"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; (a -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span>  </span><span class="annot"><span class="annottext">TermFoldM m a -&gt; TcType -&gt; Either String DataCon -&gt; a -&gt; m a
forall (m :: * -&gt; *) a.
TermFoldM m a -&gt; TcType -&gt; Either String DataCon -&gt; a -&gt; m a
</span><a href="GHC.Runtime.Heap.Inspect.html#fNewtypeWrapM"><span class="hs-identifier hs-var hs-var">fNewtypeWrapM</span></a></span><span> </span><span class="annot"><span class="annottext">TermFoldM m a
</span><a href="#local-6989586621681198011"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198010"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681198009"><span class="hs-identifier hs-var">dc</span></a></span><span>
</span><span id="line-177"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#foldTermM"><span class="hs-identifier hs-var">foldTermM</span></a></span><span> </span><span id="local-6989586621681198007"><span class="annot"><span class="annottext">TermFoldM m a
</span><a href="#local-6989586621681198007"><span class="hs-identifier hs-var">tf</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RefWrap"><span class="hs-identifier hs-type">RefWrap</span></a></span><span> </span><span id="local-6989586621681198006"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198006"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681198005"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198005"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFoldM m a -&gt; Term -&gt; m a
forall (m :: * -&gt; *) a. Monad m =&gt; TermFoldM m a -&gt; Term -&gt; m a
</span><a href="GHC.Runtime.Heap.Inspect.html#foldTermM"><span class="hs-identifier hs-var">foldTermM</span></a></span><span> </span><span class="annot"><span class="annottext">TermFoldM m a
</span><a href="#local-6989586621681198007"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681198005"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; (a -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">TermFoldM m a -&gt; TcType -&gt; a -&gt; m a
forall (m :: * -&gt; *) a. TermFoldM m a -&gt; TcType -&gt; a -&gt; m a
</span><a href="GHC.Runtime.Heap.Inspect.html#fRefWrapM"><span class="hs-identifier hs-var hs-var">fRefWrapM</span></a></span><span> </span><span class="annot"><span class="annottext">TermFoldM m a
</span><a href="#local-6989586621681198007"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198006"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#idTermFold"><span class="hs-identifier hs-type">idTermFold</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermFold"><span class="hs-identifier hs-type">TermFold</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span>
</span><span id="line-180"></span><span id="idTermFold"><span class="annot"><span class="annottext">idTermFold :: TermFold Term
</span><a href="GHC.Runtime.Heap.Inspect.html#idTermFold"><span class="hs-identifier hs-var hs-var">idTermFold</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFold :: forall a.
TermProcessor a a
-&gt; (TcType -&gt; [Word] -&gt; a)
-&gt; (ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; a)
-&gt; (TcType -&gt; Either String DataCon -&gt; a -&gt; a)
-&gt; (TcType -&gt; a -&gt; a)
-&gt; TermFold a
</span><a href="GHC.Runtime.Heap.Inspect.html#TermFold"><span class="hs-identifier hs-type">TermFold</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-181"></span><span>              </span><span class="annot"><span class="annottext">fTerm :: TermProcessor Term Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fTerm"><span class="hs-identifier hs-var">fTerm</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermProcessor Term Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-var">Term</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-182"></span><span>              </span><span class="annot"><span class="annottext">fPrim :: TcType -&gt; [Word] -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fPrim"><span class="hs-identifier hs-var">fPrim</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; [Word] -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-var">Prim</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-183"></span><span>              </span><span class="annot"><span class="annottext">fSuspension :: ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fSuspension"><span class="hs-identifier hs-var">fSuspension</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-var">Suspension</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-184"></span><span>              </span><span class="annot"><span class="annottext">fNewtypeWrap :: TcType -&gt; Either String DataCon -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fNewtypeWrap"><span class="hs-identifier hs-var">fNewtypeWrap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Either String DataCon -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#NewtypeWrap"><span class="hs-identifier hs-var">NewtypeWrap</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-185"></span><span>              </span><span class="annot"><span class="annottext">fRefWrap :: TcType -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fRefWrap"><span class="hs-identifier hs-var">fRefWrap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#RefWrap"><span class="hs-identifier hs-var">RefWrap</span></a></span><span>
</span><span id="line-186"></span><span>                      </span><span class="hs-special">}</span><span>
</span><span id="line-187"></span><span>
</span><span id="line-188"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#mapTermType"><span class="hs-identifier hs-type">mapTermType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span>
</span><span id="line-189"></span><span id="mapTermType"><span class="annot"><span class="annottext">mapTermType :: (TcType -&gt; TcType) -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#mapTermType"><span class="hs-identifier hs-var hs-var">mapTermType</span></a></span></span><span> </span><span id="local-6989586621681198002"><span class="annot"><span class="annottext">TcType -&gt; TcType
</span><a href="#local-6989586621681198002"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFold Term -&gt; Term -&gt; Term
forall a. TermFold a -&gt; Term -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#foldTerm"><span class="hs-identifier hs-var">foldTerm</span></a></span><span> </span><span class="annot"><span class="annottext">TermFold Term
</span><a href="GHC.Runtime.Heap.Inspect.html#idTermFold"><span class="hs-identifier hs-var">idTermFold</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-190"></span><span>          </span><span class="annot"><span class="annottext">fTerm :: TermProcessor Term Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fTerm"><span class="hs-identifier hs-var">fTerm</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681198001"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198001"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681198000"><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681198000"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621681197999"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197999"><span class="hs-identifier hs-var">hval</span></a></span></span><span> </span><span id="local-6989586621681197998"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197998"><span class="hs-identifier hs-var">tt</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TermProcessor Term Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-var">Term</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TcType
</span><a href="#local-6989586621681198002"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681198001"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681198000"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197999"><span class="hs-identifier hs-var">hval</span></a></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197998"><span class="hs-identifier hs-var">tt</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-191"></span><span>          </span><span class="annot"><span class="annottext">fSuspension :: ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fSuspension"><span class="hs-identifier hs-var">fSuspension</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197997"><span class="annot"><span class="annottext">ClosureType
</span><a href="#local-6989586621681197997"><span class="hs-identifier hs-var">ct</span></a></span></span><span> </span><span id="local-6989586621681197996"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197996"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681197995"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197995"><span class="hs-identifier hs-var">hval</span></a></span></span><span> </span><span id="local-6989586621681197994"><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681197994"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-192"></span><span>                          </span><span class="annot"><span class="annottext">ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-var">Suspension</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureType
</span><a href="#local-6989586621681197997"><span class="hs-identifier hs-var">ct</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TcType
</span><a href="#local-6989586621681198002"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197996"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197995"><span class="hs-identifier hs-var">hval</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681197994"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-193"></span><span>          </span><span class="annot"><span class="annottext">fNewtypeWrap :: TcType -&gt; Either String DataCon -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fNewtypeWrap"><span class="hs-identifier hs-var">fNewtypeWrap</span></a></span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197993"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197993"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681197992"><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681197992"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621681197991"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197991"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Either String DataCon -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#NewtypeWrap"><span class="hs-identifier hs-var">NewtypeWrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TcType
</span><a href="#local-6989586621681198002"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197993"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681197992"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197991"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-194"></span><span>          </span><span class="annot"><span class="annottext">fRefWrap :: TcType -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fRefWrap"><span class="hs-identifier hs-var">fRefWrap</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197990"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197990"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681197989"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197989"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#RefWrap"><span class="hs-identifier hs-var">RefWrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TcType
</span><a href="#local-6989586621681198002"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197990"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197989"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span id="local-6989586621681198581"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#mapTermTypeM"><span class="hs-identifier hs-type">mapTermTypeM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198581"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198581"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198581"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span></span><span>
</span><span id="line-197"></span><span id="mapTermTypeM"><span class="annot"><span class="annottext">mapTermTypeM :: forall (m :: * -&gt; *).
Monad m =&gt;
(TcType -&gt; m TcType) -&gt; Term -&gt; m Term
</span><a href="GHC.Runtime.Heap.Inspect.html#mapTermTypeM"><span class="hs-identifier hs-var hs-var">mapTermTypeM</span></a></span></span><span> </span><span id="local-6989586621681197976"><span class="annot"><span class="annottext">TcType -&gt; m TcType
</span><a href="#local-6989586621681197976"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFoldM m Term -&gt; Term -&gt; m Term
forall (m :: * -&gt; *) a. Monad m =&gt; TermFoldM m a -&gt; Term -&gt; m a
</span><a href="GHC.Runtime.Heap.Inspect.html#foldTermM"><span class="hs-identifier hs-var">foldTermM</span></a></span><span> </span><span class="annot"><span class="annottext">TermFoldM :: forall (m :: * -&gt; *) a.
TermProcessor a (m a)
-&gt; (TcType -&gt; [Word] -&gt; m a)
-&gt; (ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; m a)
-&gt; (TcType -&gt; Either String DataCon -&gt; a -&gt; m a)
-&gt; (TcType -&gt; a -&gt; m a)
-&gt; TermFoldM m a
</span><a href="GHC.Runtime.Heap.Inspect.html#TermFoldM"><span class="hs-identifier hs-type">TermFoldM</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-198"></span><span>          </span><span class="annot"><span class="annottext">fTermM :: TermProcessor Term (m Term)
</span><a href="GHC.Runtime.Heap.Inspect.html#fTermM"><span class="hs-identifier hs-var">fTermM</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197975"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197975"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681197974"><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681197974"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621681197973"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197973"><span class="hs-identifier hs-var">hval</span></a></span></span><span> </span><span id="local-6989586621681197972"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197972"><span class="hs-identifier hs-var">tt</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; m TcType
</span><a href="#local-6989586621681197976"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197975"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">m TcType -&gt; (TcType -&gt; m Term) -&gt; m Term
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197971"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197971"><span class="hs-identifier hs-var">ty'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Term -&gt; m Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Term -&gt; m Term) -&gt; Term -&gt; m Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TermProcessor Term Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-var">Term</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197971"><span class="hs-identifier hs-var">ty'</span></a></span><span>  </span><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681197974"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197973"><span class="hs-identifier hs-var">hval</span></a></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197972"><span class="hs-identifier hs-var">tt</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-199"></span><span>          </span><span class="annot"><span class="annottext">fPrimM :: TcType -&gt; [Word] -&gt; m Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fPrimM"><span class="hs-identifier hs-var">fPrimM</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Term -&gt; m Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span class="annot"><span class="annottext">(Term -&gt; m Term) -&gt; ([Word] -&gt; Term) -&gt; [Word] -&gt; m Term
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(([Word] -&gt; Term) -&gt; [Word] -&gt; m Term)
-&gt; (TcType -&gt; [Word] -&gt; Term) -&gt; TcType -&gt; [Word] -&gt; m Term
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; [Word] -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-var">Prim</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-200"></span><span>          </span><span class="annot"><span class="annottext">fSuspensionM :: ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; m Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fSuspensionM"><span class="hs-identifier hs-var">fSuspensionM</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197969"><span class="annot"><span class="annottext">ClosureType
</span><a href="#local-6989586621681197969"><span class="hs-identifier hs-var">ct</span></a></span></span><span> </span><span id="local-6989586621681197968"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197968"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681197967"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197967"><span class="hs-identifier hs-var">hval</span></a></span></span><span> </span><span id="local-6989586621681197966"><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681197966"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-201"></span><span>                          </span><span class="annot"><span class="annottext">TcType -&gt; m TcType
</span><a href="#local-6989586621681197976"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197968"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">m TcType -&gt; (TcType -&gt; m Term) -&gt; m Term
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197965"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197965"><span class="hs-identifier hs-var">ty'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Term -&gt; m Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Term -&gt; m Term) -&gt; Term -&gt; m Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-var">Suspension</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureType
</span><a href="#local-6989586621681197969"><span class="hs-identifier hs-var">ct</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197965"><span class="hs-identifier hs-var">ty'</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197967"><span class="hs-identifier hs-var">hval</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681197966"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-202"></span><span>          </span><span class="annot"><span class="annottext">fNewtypeWrapM :: TcType -&gt; Either String DataCon -&gt; Term -&gt; m Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fNewtypeWrapM"><span class="hs-identifier hs-var">fNewtypeWrapM</span></a></span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197964"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197964"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681197963"><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681197963"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621681197962"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197962"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; m TcType
</span><a href="#local-6989586621681197976"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197964"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">m TcType -&gt; (TcType -&gt; m Term) -&gt; m Term
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197961"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197961"><span class="hs-identifier hs-var">ty'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Term -&gt; m Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Term -&gt; m Term) -&gt; Term -&gt; m Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Either String DataCon -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#NewtypeWrap"><span class="hs-identifier hs-var">NewtypeWrap</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197961"><span class="hs-identifier hs-var">ty'</span></a></span><span> </span><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681197963"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197962"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-203"></span><span>          </span><span class="annot"><span class="annottext">fRefWrapM :: TcType -&gt; Term -&gt; m Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fRefWrapM"><span class="hs-identifier hs-var">fRefWrapM</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197960"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197960"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681197959"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197959"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; m TcType
</span><a href="#local-6989586621681197976"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197960"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">m TcType -&gt; (TcType -&gt; m Term) -&gt; m Term
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197958"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197958"><span class="hs-identifier hs-var">ty'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Term -&gt; m Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Term -&gt; m Term) -&gt; Term -&gt; m Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#RefWrap"><span class="hs-identifier hs-var">RefWrap</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197958"><span class="hs-identifier hs-var">ty'</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197959"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-204"></span><span>
</span><span id="line-205"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#termTyCoVars"><span class="hs-identifier hs-type">termTyCoVars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-206"></span><span id="termTyCoVars"><span class="annot"><span class="annottext">termTyCoVars :: Term -&gt; TyCoVarSet
</span><a href="GHC.Runtime.Heap.Inspect.html#termTyCoVars"><span class="hs-identifier hs-var hs-var">termTyCoVars</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFold TyCoVarSet -&gt; Term -&gt; TyCoVarSet
forall a. TermFold a -&gt; Term -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#foldTerm"><span class="hs-identifier hs-var">foldTerm</span></a></span><span> </span><span class="annot"><span class="annottext">TermFold :: forall a.
TermProcessor a a
-&gt; (TcType -&gt; [Word] -&gt; a)
-&gt; (ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; a)
-&gt; (TcType -&gt; Either String DataCon -&gt; a -&gt; a)
-&gt; (TcType -&gt; a -&gt; a)
-&gt; TermFold a
</span><a href="GHC.Runtime.Heap.Inspect.html#TermFold"><span class="hs-identifier hs-type">TermFold</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-207"></span><span>            </span><span class="annot"><span class="annottext">fTerm :: TermProcessor TyCoVarSet TyCoVarSet
</span><a href="GHC.Runtime.Heap.Inspect.html#fTerm"><span class="hs-identifier hs-var">fTerm</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197957"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197957"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="annot"><span class="annottext">Either String DataCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681197956"><span class="annot"><span class="annottext">[TyCoVarSet]
</span><a href="#local-6989586621681197956"><span class="hs-identifier hs-var">tt</span></a></span></span><span>   </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-208"></span><span>                          </span><span class="annot"><span class="annottext">TcType -&gt; TyCoVarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfType"><span class="hs-identifier hs-var">tyCoVarsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197957"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarSet -&gt; TyCoVarSet -&gt; TyCoVarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVarSet] -&gt; TyCoVarSet
</span><a href="#local-6989586621681197953"><span class="hs-identifier hs-var">concatVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVarSet]
</span><a href="#local-6989586621681197956"><span class="hs-identifier hs-var">tt</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-209"></span><span>            </span><span class="annot"><span class="annottext">fSuspension :: ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; TyCoVarSet
</span><a href="GHC.Runtime.Heap.Inspect.html#fSuspension"><span class="hs-identifier hs-var">fSuspension</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">ClosureType
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681197952"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197952"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TyCoVarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfType"><span class="hs-identifier hs-var">tyCoVarsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197952"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-210"></span><span>            </span><span class="annot"><span class="annottext">fPrim :: TcType -&gt; [Word] -&gt; TyCoVarSet
</span><a href="GHC.Runtime.Heap.Inspect.html#fPrim"><span class="hs-identifier hs-var">fPrim</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">TcType
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Word]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TyCoVarSet
</span><a href="GHC.Types.Var.Set.html#emptyVarSet"><span class="hs-identifier hs-var">emptyVarSet</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-211"></span><span>            </span><span class="annot"><span class="annottext">fNewtypeWrap :: TcType -&gt; Either String DataCon -&gt; TyCoVarSet -&gt; TyCoVarSet
</span><a href="GHC.Runtime.Heap.Inspect.html#fNewtypeWrap"><span class="hs-identifier hs-var">fNewtypeWrap</span></a></span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197950"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197950"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="annot"><span class="annottext">Either String DataCon
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681197949"><span class="annot"><span class="annottext">TyCoVarSet
</span><a href="#local-6989586621681197949"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TyCoVarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfType"><span class="hs-identifier hs-var">tyCoVarsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197950"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarSet -&gt; TyCoVarSet -&gt; TyCoVarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarSet
</span><a href="#local-6989586621681197949"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-212"></span><span>            </span><span class="annot"><span class="annottext">fRefWrap :: TcType -&gt; TyCoVarSet -&gt; TyCoVarSet
</span><a href="GHC.Runtime.Heap.Inspect.html#fRefWrap"><span class="hs-identifier hs-var">fRefWrap</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197948"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197948"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681197947"><span class="annot"><span class="annottext">TyCoVarSet
</span><a href="#local-6989586621681197947"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TyCoVarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfType"><span class="hs-identifier hs-var">tyCoVarsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197948"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarSet -&gt; TyCoVarSet -&gt; TyCoVarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarSet
</span><a href="#local-6989586621681197947"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-213"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681197953"><span class="annot"><span class="annottext">concatVarEnv :: [TyCoVarSet] -&gt; TyCoVarSet
</span><a href="#local-6989586621681197953"><span class="hs-identifier hs-var hs-var">concatVarEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TyCoVarSet -&gt; TyCoVarSet -&gt; TyCoVarSet)
-&gt; TyCoVarSet -&gt; [TyCoVarSet] -&gt; TyCoVarSet
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarSet -&gt; TyCoVarSet -&gt; TyCoVarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-identifier hs-var">unionVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarSet
</span><a href="GHC.Types.Var.Set.html#emptyVarSet"><span class="hs-identifier hs-var">emptyVarSet</span></a></span><span>
</span><span id="line-214"></span><span>
</span><span id="line-215"></span><span class="hs-comment">----------------------------------</span><span>
</span><span id="line-216"></span><span class="hs-comment">-- Pretty printing of terms</span><span>
</span><span id="line-217"></span><span class="hs-comment">----------------------------------</span><span>
</span><span id="line-218"></span><span>
</span><span id="line-219"></span><span class="hs-keyword">type</span><span> </span><span id="Precedence"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Precedence"><span class="hs-identifier hs-var">Precedence</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-220"></span><span class="hs-keyword">type</span><span> </span><span id="TermPrinterM"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermPrinterM"><span class="hs-identifier hs-var">TermPrinterM</span></a></span></span><span> </span><span id="local-6989586621681197943"><span class="annot"><a href="#local-6989586621681197943"><span class="hs-identifier hs-type">m</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Precedence"><span class="hs-identifier hs-type">Precedence</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681197943"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-221"></span><span>
</span><span id="line-222"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#app_prec"><span class="hs-identifier hs-type">app_prec</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#cons_prec"><span class="hs-identifier hs-type">cons_prec</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#max_prec"><span class="hs-identifier hs-type">max_prec</span></a></span><span> </span><span class="hs-glyph">::</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-223"></span><span id="max_prec"><span class="annot"><span class="annottext">max_prec :: Int
</span><a href="GHC.Runtime.Heap.Inspect.html#max_prec"><span class="hs-identifier hs-var hs-var">max_prec</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">10</span></span><span>
</span><span id="line-224"></span><span id="app_prec"><span class="annot"><span class="annottext">app_prec :: Int
</span><a href="GHC.Runtime.Heap.Inspect.html#app_prec"><span class="hs-identifier hs-var hs-var">app_prec</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Runtime.Heap.Inspect.html#max_prec"><span class="hs-identifier hs-var">max_prec</span></a></span><span>
</span><span id="line-225"></span><span id="cons_prec"><span class="annot"><span class="annottext">cons_prec :: Int
</span><a href="GHC.Runtime.Heap.Inspect.html#cons_prec"><span class="hs-identifier hs-var hs-var">cons_prec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">5</span></span><span> </span><span class="hs-comment">-- TODO Extract this info from GHC itself</span><span>
</span><span id="line-226"></span><span>
</span><span id="line-227"></span><span id="local-6989586621681198569"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#pprTermM"><span class="hs-identifier hs-type">pprTermM</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#ppr_termM"><span class="hs-identifier hs-type">ppr_termM</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#pprNewtypeWrap"><span class="hs-identifier hs-type">pprNewtypeWrap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198569"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermPrinterM"><span class="hs-identifier hs-type">TermPrinterM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198569"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermPrinterM"><span class="hs-identifier hs-type">TermPrinterM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198569"><span class="hs-identifier hs-type">m</span></a></span></span><span>
</span><span id="line-228"></span><span id="pprTermM"><span class="annot"><span class="annottext">pprTermM :: forall (m :: * -&gt; *). Monad m =&gt; TermPrinterM m -&gt; TermPrinterM m
</span><a href="GHC.Runtime.Heap.Inspect.html#pprTermM"><span class="hs-identifier hs-var hs-var">pprTermM</span></a></span></span><span> </span><span id="local-6989586621681197933"><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197933"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621681197932"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197932"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621681197931"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197931"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#pprDeeper"><span class="hs-identifier hs-var">pprDeeper</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; m SDoc -&gt; m SDoc
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-operator hs-var">`liftM`</span></a></span><span> </span><span class="annot"><span class="annottext">TermPrinterM m -&gt; TermPrinterM m
forall (m :: * -&gt; *). Monad m =&gt; TermPrinterM m -&gt; TermPrinterM m
</span><a href="GHC.Runtime.Heap.Inspect.html#ppr_termM"><span class="hs-identifier hs-var">ppr_termM</span></a></span><span> </span><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197933"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197932"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197931"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-229"></span><span>
</span><span id="line-230"></span><span id="ppr_termM"><span class="annot"><span class="annottext">ppr_termM :: forall (m :: * -&gt; *). Monad m =&gt; TermPrinterM m -&gt; TermPrinterM m
</span><a href="GHC.Runtime.Heap.Inspect.html#ppr_termM"><span class="hs-identifier hs-var hs-var">ppr_termM</span></a></span></span><span> </span><span id="local-6989586621681197911"><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197911"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621681197910"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197910"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">dc :: Term -&gt; Either String DataCon
</span><a href="GHC.Runtime.Heap.Inspect.html#dc"><span class="hs-identifier hs-var">dc</span></a></span><span class="hs-glyph">=</span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621681197909"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681197909"><span class="hs-identifier hs-var">dc_tag</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197908"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197908"><span class="hs-identifier hs-var">tt</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-231"></span><span>  </span><span id="local-6989586621681197907"><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681197907"><span class="hs-identifier hs-var">tt_docs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; m SDoc) -&gt; [Term] -&gt; m [SDoc]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197911"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Runtime.Heap.Inspect.html#app_prec"><span class="hs-identifier hs-var">app_prec</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197908"><span class="hs-identifier hs-var">tt</span></a></span><span>
</span><span id="line-232"></span><span>  </span><span class="annot"><span class="annottext">SDoc -&gt; m SDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; m SDoc) -&gt; SDoc -&gt; m SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#cparen"><span class="hs-identifier hs-var">cparen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Term] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197908"><span class="hs-identifier hs-var">tt</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197910"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Runtime.Heap.Inspect.html#app_prec"><span class="hs-identifier hs-var">app_prec</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-233"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681197909"><span class="hs-identifier hs-var">dc_tag</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#pprDeeperList"><span class="hs-identifier hs-var">pprDeeperList</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#fsep"><span class="hs-identifier hs-var">fsep</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681197907"><span class="hs-identifier hs-var">tt_docs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#ppr_termM"><span class="hs-identifier hs-var">ppr_termM</span></a></span><span> </span><span id="local-6989586621681197898"><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197898"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621681197897"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197897"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">dc :: Term -&gt; Either String DataCon
</span><a href="GHC.Runtime.Heap.Inspect.html#dc"><span class="hs-identifier hs-var">dc</span></a></span><span class="hs-glyph">=</span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681197896"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197896"><span class="hs-identifier hs-var">dc</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197895"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197895"><span class="hs-identifier hs-var">tt</span></a></span></span><span class="hs-special">}</span><span>
</span><span id="line-236"></span><span class="hs-comment">{-  | dataConIsInfix dc, (t1:t2:tt') &lt;- tt  --TODO fixity
  = parens (ppr_term1 True t1 &lt;+&gt; ppr dc &lt;+&gt; ppr_term1 True ppr t2)
    &lt;+&gt; hsep (map (ppr_term1 True) tt)
-}</span><span> </span><span class="hs-comment">-- TODO Printing infix constructors properly</span><span>
</span><span id="line-240"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681197894"><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681197894"><span class="hs-identifier hs-var">tt_docs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; m SDoc) -&gt; [Term] -&gt; m [SDoc]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197898"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Runtime.Heap.Inspect.html#app_prec"><span class="hs-identifier hs-var">app_prec</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197895"><span class="hs-identifier hs-var">tt</span></a></span><span>
</span><span id="line-241"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; m SDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; m SDoc) -&gt; SDoc -&gt; m SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ifPprDebug"><span class="hs-identifier hs-var">ifPprDebug</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="#local-6989586621681197892"><span class="hs-identifier hs-var">show_tm</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681197894"><span class="hs-identifier hs-var">tt_docs'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-242"></span><span>                             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="#local-6989586621681197892"><span class="hs-identifier hs-var">show_tm</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TcType] -&gt; [SDoc] -&gt; [SDoc]
forall b a. [b] -&gt; [a] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#dropList"><span class="hs-identifier hs-var">dropList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; [TcType]
</span><a href="GHC.Core.DataCon.html#dataConTheta"><span class="hs-identifier hs-var">dataConTheta</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197896"><span class="hs-identifier hs-var">dc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681197894"><span class="hs-identifier hs-var">tt_docs'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-243"></span><span>                  </span><span class="hs-comment">-- Don't show the dictionary arguments to</span><span>
</span><span id="line-244"></span><span>                  </span><span class="hs-comment">-- constructors unless -dppr-debug is on</span><span>
</span><span id="line-245"></span><span>       </span><span class="hs-special">}</span><span>
</span><span id="line-246"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-247"></span><span>    </span><span id="local-6989586621681197892"><span class="annot"><span class="annottext">show_tm :: [SDoc] -&gt; SDoc
</span><a href="#local-6989586621681197892"><span class="hs-identifier hs-var hs-var">show_tm</span></a></span></span><span> </span><span id="local-6989586621681197885"><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681197885"><span class="hs-identifier hs-var">tt_docs</span></a></span></span><span>
</span><span id="line-248"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681197885"><span class="hs-identifier hs-var">tt_docs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197896"><span class="hs-identifier hs-var">dc</span></a></span><span>
</span><span id="line-249"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#cparen"><span class="hs-identifier hs-var">cparen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197897"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Runtime.Heap.Inspect.html#app_prec"><span class="hs-identifier hs-var">app_prec</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; SDoc -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-250"></span><span>                       </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">DataCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197896"><span class="hs-identifier hs-var">dc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#pprDeeperList"><span class="hs-identifier hs-var">pprDeeperList</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#fsep"><span class="hs-identifier hs-var">fsep</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681197885"><span class="hs-identifier hs-var">tt_docs</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-251"></span><span>
</span><span id="line-252"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#ppr_termM"><span class="hs-identifier hs-var">ppr_termM</span></a></span><span> </span><span id="local-6989586621681197882"><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197882"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621681197881"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197881"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621681197880"><span class="annot"><span class="annottext">t :: Term
</span><a href="#local-6989586621681197880"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#NewtypeWrap"><span class="hs-identifier hs-type">NewtypeWrap</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermPrinterM m -&gt; TermPrinterM m
forall (m :: * -&gt; *). Monad m =&gt; TermPrinterM m -&gt; TermPrinterM m
</span><a href="GHC.Runtime.Heap.Inspect.html#pprNewtypeWrap"><span class="hs-identifier hs-var">pprNewtypeWrap</span></a></span><span> </span><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197882"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197881"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197880"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-253"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#ppr_termM"><span class="hs-identifier hs-var">ppr_termM</span></a></span><span> </span><span id="local-6989586621681197879"><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197879"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621681197878"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197878"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RefWrap"><span class="hs-identifier hs-type">RefWrap</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">wrapped_term :: Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#wrapped_term"><span class="hs-identifier hs-var">wrapped_term</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197877"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197877"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">}</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-254"></span><span>  </span><span id="local-6989586621681197876"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681197876"><span class="hs-identifier hs-var">contents</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197879"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Runtime.Heap.Inspect.html#app_prec"><span class="hs-identifier hs-var">app_prec</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197877"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-255"></span><span>  </span><span class="annot"><span class="annottext">SDoc -&gt; m SDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span class="annot"><span class="annottext">(SDoc -&gt; m SDoc) -&gt; SDoc -&gt; m SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#cparen"><span class="hs-identifier hs-var">cparen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197878"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Runtime.Heap.Inspect.html#app_prec"><span class="hs-identifier hs-var">app_prec</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;GHC.Prim.MutVar#&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681197876"><span class="hs-identifier hs-var">contents</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-256"></span><span>  </span><span class="hs-comment">-- The constructor name is wired in here ^^^ for the sake of simplicity.</span><span>
</span><span id="line-257"></span><span>  </span><span class="hs-comment">-- I don't think mutvars are going to change in a near future.</span><span>
</span><span id="line-258"></span><span>  </span><span class="hs-comment">-- In any case this is solely a presentation matter: MutVar# is</span><span>
</span><span id="line-259"></span><span>  </span><span class="hs-comment">-- a datatype with no constructors, implemented by the RTS</span><span>
</span><span id="line-260"></span><span>  </span><span class="hs-comment">-- (hence there is no way to obtain a datacon and print it).</span><span>
</span><span id="line-261"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#ppr_termM"><span class="hs-identifier hs-var">ppr_termM</span></a></span><span> </span><span class="annot"><span class="annottext">TermPrinterM m
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681197875"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197875"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Term -&gt; m SDoc
forall (m :: * -&gt; *). Monad m =&gt; Term -&gt; m SDoc
</span><a href="GHC.Runtime.Heap.Inspect.html#ppr_termM1"><span class="hs-identifier hs-var">ppr_termM1</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197875"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-262"></span><span>
</span><span id="line-263"></span><span>
</span><span id="line-264"></span><span id="local-6989586621681198558"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#ppr_termM1"><span class="hs-identifier hs-type">ppr_termM1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198558"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198558"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span></span><span>
</span><span id="line-265"></span><span id="ppr_termM1"><span class="annot"><span class="annottext">ppr_termM1 :: forall (m :: * -&gt; *). Monad m =&gt; Term -&gt; m SDoc
</span><a href="GHC.Runtime.Heap.Inspect.html#ppr_termM1"><span class="hs-identifier hs-var hs-var">ppr_termM1</span></a></span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-type">Prim</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">valRaw :: Term -&gt; [Word]
</span><a href="GHC.Runtime.Heap.Inspect.html#valRaw"><span class="hs-identifier hs-var">valRaw</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197866"><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197866"><span class="hs-identifier hs-var">words</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ty :: Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197865"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197865"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-266"></span><span>    </span><span class="annot"><span class="annottext">SDoc -&gt; m SDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; m SDoc) -&gt; SDoc -&gt; m SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [Word] -&gt; SDoc
</span><a href="GHC.Runtime.Heap.Inspect.html#repPrim"><span class="hs-identifier hs-var">repPrim</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TyCon
</span><a href="GHC.Core.Type.html#tyConAppTyCon"><span class="hs-identifier hs-var">tyConAppTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197865"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197866"><span class="hs-identifier hs-var">words</span></a></span><span>
</span><span id="line-267"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#ppr_termM1"><span class="hs-identifier hs-var">ppr_termM1</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-type">Suspension</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">ty :: Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197862"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197862"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bound_to :: Term -&gt; Maybe Name
</span><a href="GHC.Runtime.Heap.Inspect.html#bound_to"><span class="hs-identifier hs-var">bound_to</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Maybe Name
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-268"></span><span>    </span><span class="annot"><span class="annottext">SDoc -&gt; m SDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'_'</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#whenPprDebug"><span class="hs-identifier hs-var">whenPprDebug</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;::&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197862"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-269"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#ppr_termM1"><span class="hs-identifier hs-var">ppr_termM1</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-type">Suspension</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">ty :: Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197858"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197858"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">bound_to :: Term -&gt; Maybe Name
</span><a href="GHC.Runtime.Heap.Inspect.html#bound_to"><span class="hs-identifier hs-var">bound_to</span></a></span><span class="hs-glyph">=</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681197857"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681197857"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">}</span><span>
</span><span id="line-270"></span><span class="hs-comment">--  | Just _ &lt;- splitFunTy_maybe ty = return$ ptext (sLit(&quot;&lt;function&gt;&quot;)</span><span>
</span><span id="line-271"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; m SDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span class="annot"><span class="annottext">(SDoc -&gt; m SDoc) -&gt; SDoc -&gt; m SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; SDoc -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681197857"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;::&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197858"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-272"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#ppr_termM1"><span class="hs-identifier hs-var">ppr_termM1</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; m SDoc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ppr_termM1 - Term&quot;</span></span><span>
</span><span id="line-273"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#ppr_termM1"><span class="hs-identifier hs-var">ppr_termM1</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RefWrap"><span class="hs-identifier hs-type">RefWrap</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; m SDoc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ppr_termM1 - RefWrap&quot;</span></span><span>
</span><span id="line-274"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#ppr_termM1"><span class="hs-identifier hs-var">ppr_termM1</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#NewtypeWrap"><span class="hs-identifier hs-type">NewtypeWrap</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; m SDoc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ppr_termM1 - NewtypeWrap&quot;</span></span><span>
</span><span id="line-275"></span><span>
</span><span id="line-276"></span><span id="pprNewtypeWrap"><span class="annot"><span class="annottext">pprNewtypeWrap :: forall (m :: * -&gt; *). Monad m =&gt; TermPrinterM m -&gt; TermPrinterM m
</span><a href="GHC.Runtime.Heap.Inspect.html#pprNewtypeWrap"><span class="hs-identifier hs-var hs-var">pprNewtypeWrap</span></a></span></span><span> </span><span id="local-6989586621681197848"><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197848"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621681197847"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197847"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#NewtypeWrap"><span class="hs-identifier hs-type">NewtypeWrap</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">ty :: Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197846"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197846"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">wrapped_term :: Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#wrapped_term"><span class="hs-identifier hs-var">wrapped_term</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197845"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197845"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">}</span><span>
</span><span id="line-277"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197844"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197844"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[TcType]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; TcType -&gt; Maybe (TyCon, [TcType])
TcType -&gt; Maybe (TyCon, [TcType])
</span><a href="GHC.Core.Type.html#tcSplitTyConApp_maybe"><span class="hs-identifier hs-var">tcSplitTyConApp_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197846"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-278"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">isNewTyCon</span><span> </span><span class="hs-identifier">tc</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">True</span><span>
</span><span id="line-279"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681197839"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197839"><span class="hs-identifier hs-var">new_dc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Maybe DataCon
</span><a href="GHC.Core.TyCon.html#tyConSingleDataCon_maybe"><span class="hs-identifier hs-var">tyConSingleDataCon_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197844"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-280"></span><span>             </span><span id="local-6989586621681197837"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681197837"><span class="hs-identifier hs-var">real_term</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197848"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Runtime.Heap.Inspect.html#max_prec"><span class="hs-identifier hs-var">max_prec</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197845"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-281"></span><span>             </span><span class="annot"><span class="annottext">SDoc -&gt; m SDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; m SDoc) -&gt; SDoc -&gt; m SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#cparen"><span class="hs-identifier hs-var">cparen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197847"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Runtime.Heap.Inspect.html#app_prec"><span class="hs-identifier hs-var">app_prec</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197839"><span class="hs-identifier hs-var">new_dc</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681197837"><span class="hs-identifier hs-var">real_term</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-282"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#pprNewtypeWrap"><span class="hs-identifier hs-var">pprNewtypeWrap</span></a></span><span> </span><span class="annot"><span class="annottext">TermPrinterM m
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Term
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; m SDoc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;pprNewtypeWrap&quot;</span></span><span>
</span><span id="line-283"></span><span>
</span><span id="line-284"></span><span class="hs-comment">-------------------------------------------------------</span><span>
</span><span id="line-285"></span><span class="hs-comment">-- Custom Term Pretty Printers</span><span>
</span><span id="line-286"></span><span class="hs-comment">-------------------------------------------------------</span><span>
</span><span id="line-287"></span><span>
</span><span id="line-288"></span><span class="hs-comment">-- We can want to customize the representation of a</span><span>
</span><span id="line-289"></span><span class="hs-comment">--  term depending on its type.</span><span>
</span><span id="line-290"></span><span class="hs-comment">-- However, note that custom printers have to work with</span><span>
</span><span id="line-291"></span><span class="hs-comment">--  type representations, instead of directly with types.</span><span>
</span><span id="line-292"></span><span class="hs-comment">-- We cannot use type classes here, unless we employ some</span><span>
</span><span id="line-293"></span><span class="hs-comment">--  typerep trickery (e.g. Weirich's RepLib tricks),</span><span>
</span><span id="line-294"></span><span class="hs-comment">--  which I didn't. Therefore, this code replicates a lot</span><span>
</span><span id="line-295"></span><span class="hs-comment">--  of what type classes provide for free.</span><span>
</span><span id="line-296"></span><span>
</span><span id="line-297"></span><span class="hs-keyword">type</span><span> </span><span id="CustomTermPrinter"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#CustomTermPrinter"><span class="hs-identifier hs-var">CustomTermPrinter</span></a></span></span><span> </span><span id="local-6989586621681197836"><span class="annot"><a href="#local-6989586621681197836"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermPrinterM"><span class="hs-identifier hs-type">TermPrinterM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681197836"><span class="hs-identifier hs-type">m</span></a></span><span>
</span><span id="line-298"></span><span>                         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Precedence"><span class="hs-identifier hs-type">Precedence</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681197836"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-299"></span><span>
</span><span id="line-300"></span><span class="hs-comment">-- | Takes a list of custom printers with a explicit recursion knot and a term,</span><span>
</span><span id="line-301"></span><span class="hs-comment">-- and returns the output of the first successful printer, or the default printer</span><span>
</span><span id="line-302"></span><span id="local-6989586621681198642"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#cPprTerm"><span class="hs-identifier hs-type">cPprTerm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198642"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#CustomTermPrinter"><span class="hs-identifier hs-type">CustomTermPrinter</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198642"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198642"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span></span><span>
</span><span id="line-303"></span><span id="cPprTerm"><span class="annot"><span class="annottext">cPprTerm :: forall (m :: * -&gt; *).
Monad m =&gt;
CustomTermPrinter m -&gt; Term -&gt; m SDoc
</span><a href="GHC.Runtime.Heap.Inspect.html#cPprTerm"><span class="hs-identifier hs-var hs-var">cPprTerm</span></a></span></span><span> </span><span id="local-6989586621681197834"><span class="annot"><span class="annottext">CustomTermPrinter m
</span><a href="#local-6989586621681197834"><span class="hs-identifier hs-var">printers_</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197833"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-304"></span><span>  </span><span id="local-6989586621681197826"><span class="annot"><span class="annottext">printers :: [Int -&gt; Term -&gt; m (Maybe SDoc)]
</span><a href="#local-6989586621681197826"><span class="hs-identifier hs-var hs-var">printers</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CustomTermPrinter m
</span><a href="#local-6989586621681197834"><span class="hs-identifier hs-var">printers_</span></a></span><span> </span><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197833"><span class="hs-identifier hs-var">go</span></a></span><span>
</span><span id="line-305"></span><span>  </span><span id="local-6989586621681197833"><span class="annot"><span class="annottext">go :: TermPrinterM m
</span><a href="#local-6989586621681197833"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621681197825"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197825"><span class="hs-identifier hs-var">prec</span></a></span></span><span> </span><span id="local-6989586621681197824"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197824"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-306"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681197821"><span class="annot"><span class="annottext">default_ :: m (Maybe SDoc)
</span><a href="#local-6989586621681197821"><span class="hs-identifier hs-var hs-var">default_</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Maybe SDoc
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; Maybe SDoc) -&gt; m SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-operator hs-var">`liftM`</span></a></span><span> </span><span class="annot"><span class="annottext">TermPrinterM m -&gt; TermPrinterM m
forall (m :: * -&gt; *). Monad m =&gt; TermPrinterM m -&gt; TermPrinterM m
</span><a href="GHC.Runtime.Heap.Inspect.html#pprTermM"><span class="hs-identifier hs-var">pprTermM</span></a></span><span> </span><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197833"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197825"><span class="hs-identifier hs-var">prec</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197824"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-307"></span><span>        </span><span id="local-6989586621681197820"><span class="annot"><span class="annottext">mb_customDocs :: [m (Maybe SDoc)]
</span><a href="#local-6989586621681197820"><span class="hs-identifier hs-var hs-var">mb_customDocs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197819"><span class="hs-identifier hs-var">pp</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197825"><span class="hs-identifier hs-var">prec</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197824"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681197819"><span class="annot"><span class="annottext">Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197819"><span class="hs-identifier hs-var">pp</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Int -&gt; Term -&gt; m (Maybe SDoc)]
</span><a href="#local-6989586621681197826"><span class="hs-identifier hs-var">printers</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[m (Maybe SDoc)] -&gt; [m (Maybe SDoc)] -&gt; [m (Maybe SDoc)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">m (Maybe SDoc)
</span><a href="#local-6989586621681197821"><span class="hs-identifier hs-var">default_</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-308"></span><span>    </span><span id="local-6989586621681197818"><span class="annot"><span class="annottext">Maybe SDoc
</span><a href="#local-6989586621681197818"><span class="hs-identifier hs-var">mdoc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[m (Maybe SDoc)] -&gt; m (Maybe SDoc)
forall {m :: * -&gt; *} {a}. Monad m =&gt; [m (Maybe a)] -&gt; m (Maybe a)
</span><a href="#local-6989586621681197817"><span class="hs-identifier hs-var">firstJustM</span></a></span><span> </span><span class="annot"><span class="annottext">[m (Maybe SDoc)]
</span><a href="#local-6989586621681197820"><span class="hs-identifier hs-var">mb_customDocs</span></a></span><span>
</span><span id="line-309"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe SDoc
</span><a href="#local-6989586621681197818"><span class="hs-identifier hs-var">mdoc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-310"></span><span>      </span><span class="annot"><span class="annottext">Maybe SDoc
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; m SDoc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cPprTerm&quot;</span></span><span>
</span><span id="line-311"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681197816"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681197816"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; m SDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; m SDoc) -&gt; SDoc -&gt; m SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#cparen"><span class="hs-identifier hs-var">cparen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197825"><span class="hs-identifier hs-var">prec</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Runtime.Heap.Inspect.html#app_prec"><span class="hs-identifier hs-var">app_prec</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681197816"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-312"></span><span>
</span><span id="line-313"></span><span>  </span><span id="local-6989586621681197817"><span class="annot"><span class="annottext">firstJustM :: [m (Maybe a)] -&gt; m (Maybe a)
</span><a href="#local-6989586621681197817"><span class="hs-identifier hs-var hs-var">firstJustM</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197809"><span class="annot"><span class="annottext">m (Maybe a)
</span><a href="#local-6989586621681197809"><span class="hs-identifier hs-var">mb</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681197808"><span class="annot"><span class="annottext">[m (Maybe a)]
</span><a href="#local-6989586621681197808"><span class="hs-identifier hs-var">mbs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Maybe a)
</span><a href="#local-6989586621681197809"><span class="hs-identifier hs-var">mb</span></a></span><span> </span><span class="annot"><span class="annottext">m (Maybe a) -&gt; (Maybe a -&gt; m (Maybe a)) -&gt; m (Maybe a)
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">m (Maybe a) -&gt; (a -&gt; m (Maybe a)) -&gt; Maybe a -&gt; m (Maybe a)
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[m (Maybe a)] -&gt; m (Maybe a)
</span><a href="#local-6989586621681197817"><span class="hs-identifier hs-var">firstJustM</span></a></span><span> </span><span class="annot"><span class="annottext">[m (Maybe a)]
</span><a href="#local-6989586621681197808"><span class="hs-identifier hs-var">mbs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe a -&gt; m (Maybe a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe a -&gt; m (Maybe a)) -&gt; (a -&gt; Maybe a) -&gt; a -&gt; m (Maybe a)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe a
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-314"></span><span>  </span><span class="annot"><a href="#local-6989586621681197817"><span class="hs-identifier hs-var">firstJustM</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe a -&gt; m (Maybe a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe a
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-315"></span><span>
</span><span id="line-316"></span><span class="hs-comment">-- Default set of custom printers. Note that the recursion knot is explicit</span><span>
</span><span id="line-317"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#cPprTermBase"><span class="hs-identifier hs-type">cPprTermBase</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621681198641"><span class="annot"><a href="#local-6989586621681198641"><span class="hs-identifier hs-type">m</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198641"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#CustomTermPrinter"><span class="hs-identifier hs-type">CustomTermPrinter</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198641"><span class="hs-identifier hs-type">m</span></a></span><span>
</span><span id="line-318"></span><span id="cPprTermBase"><span class="annot"><span class="annottext">cPprTermBase :: forall (m :: * -&gt; *). Monad m =&gt; CustomTermPrinter m
</span><a href="GHC.Runtime.Heap.Inspect.html#cPprTermBase"><span class="hs-identifier hs-var hs-var">cPprTermBase</span></a></span></span><span> </span><span id="local-6989586621681197750"><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197750"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-319"></span><span>  </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; Bool) -&gt; TermPrinterM m -&gt; Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197749"><span class="hs-identifier hs-var">ifTerm</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; Bool
</span><a href="#local-6989586621681197748"><span class="hs-identifier hs-var">isTupleTy</span></a></span><span class="annot"><span class="annottext">(TcType -&gt; Bool) -&gt; (Term -&gt; TcType) -&gt; Term -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span class="annot"><span class="annottext">Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681197747"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197747"><span class="hs-identifier hs-var">_p</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; m [SDoc] -&gt; m SDoc
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; ([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hcat"><span class="hs-identifier hs-var">hcat</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; ([SDoc] -&gt; [SDoc]) -&gt; [SDoc] -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; [SDoc] -&gt; [SDoc]
</span><a href="GHC.Utils.Outputable.html#punctuate"><span class="hs-identifier hs-var">punctuate</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#comma"><span class="hs-identifier hs-var">comma</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-320"></span><span>                                      </span><span class="annot"><span class="annottext">(m [SDoc] -&gt; m SDoc) -&gt; (Term -&gt; m [SDoc]) -&gt; Term -&gt; m SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Term -&gt; m SDoc) -&gt; [Term] -&gt; m [SDoc]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197750"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-321"></span><span>                                      </span><span class="annot"><span class="annottext">([Term] -&gt; m [SDoc]) -&gt; (Term -&gt; [Term]) -&gt; Term -&gt; m [SDoc]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var hs-var">subTerms</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-322"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; Bool) -&gt; TermPrinterM m -&gt; Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197749"><span class="hs-identifier hs-var">ifTerm</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681197743"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197743"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TcType -&gt; Bool
</span><a href="#local-6989586621681197742"><span class="hs-identifier hs-var">isTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.html#listTyCon"><span class="hs-identifier hs-var">listTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197743"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var hs-var">subTerms</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197743"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">[Term] -&gt; Int -&gt; Bool
forall a. [a] -&gt; Int -&gt; Bool
</span><a href="GHC.Utils.Misc.html#lengthIs"><span class="hs-operator hs-var">`lengthIs`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span class="hs-special">)</span><span>
</span><span id="line-323"></span><span>           </span><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197739"><span class="hs-identifier hs-var">ppr_list</span></a></span><span>
</span><span id="line-324"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; Bool)
-&gt; (Int -&gt; Term -&gt; m (Maybe SDoc)) -&gt; Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197738"><span class="hs-identifier hs-var">ifTerm'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; TcType -&gt; Bool
</span><a href="#local-6989586621681197742"><span class="hs-identifier hs-var">isTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.html#intTyCon"><span class="hs-identifier hs-var">intTyCon</span></a></span><span>     </span><span class="annot"><span class="annottext">(TcType -&gt; Bool) -&gt; (Term -&gt; TcType) -&gt; Term -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197736"><span class="hs-identifier hs-var">ppr_int</span></a></span><span>
</span><span id="line-325"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; Bool)
-&gt; (Int -&gt; Term -&gt; m (Maybe SDoc)) -&gt; Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197738"><span class="hs-identifier hs-var">ifTerm'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; TcType -&gt; Bool
</span><a href="#local-6989586621681197742"><span class="hs-identifier hs-var">isTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.html#charTyCon"><span class="hs-identifier hs-var">charTyCon</span></a></span><span>    </span><span class="annot"><span class="annottext">(TcType -&gt; Bool) -&gt; (Term -&gt; TcType) -&gt; Term -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197734"><span class="hs-identifier hs-var">ppr_char</span></a></span><span>
</span><span id="line-326"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; Bool)
-&gt; (Int -&gt; Term -&gt; m (Maybe SDoc)) -&gt; Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197738"><span class="hs-identifier hs-var">ifTerm'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; TcType -&gt; Bool
</span><a href="#local-6989586621681197742"><span class="hs-identifier hs-var">isTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.html#floatTyCon"><span class="hs-identifier hs-var">floatTyCon</span></a></span><span>   </span><span class="annot"><span class="annottext">(TcType -&gt; Bool) -&gt; (Term -&gt; TcType) -&gt; Term -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197732"><span class="hs-identifier hs-var">ppr_float</span></a></span><span>
</span><span id="line-327"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; Bool)
-&gt; (Int -&gt; Term -&gt; m (Maybe SDoc)) -&gt; Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197738"><span class="hs-identifier hs-var">ifTerm'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; TcType -&gt; Bool
</span><a href="#local-6989586621681197742"><span class="hs-identifier hs-var">isTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.html#doubleTyCon"><span class="hs-identifier hs-var">doubleTyCon</span></a></span><span>  </span><span class="annot"><span class="annottext">(TcType -&gt; Bool) -&gt; (Term -&gt; TcType) -&gt; Term -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197730"><span class="hs-identifier hs-var">ppr_double</span></a></span><span>
</span><span id="line-328"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; Bool)
-&gt; (Int -&gt; Term -&gt; m (Maybe SDoc)) -&gt; Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197738"><span class="hs-identifier hs-var">ifTerm'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; TcType -&gt; Bool
</span><a href="#local-6989586621681197742"><span class="hs-identifier hs-var">isTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.html#integerTyCon"><span class="hs-identifier hs-var">integerTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType -&gt; Bool) -&gt; (Term -&gt; TcType) -&gt; Term -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197728"><span class="hs-identifier hs-var">ppr_integer</span></a></span><span>
</span><span id="line-329"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; Bool)
-&gt; (Int -&gt; Term -&gt; m (Maybe SDoc)) -&gt; Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197738"><span class="hs-identifier hs-var">ifTerm'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; TcType -&gt; Bool
</span><a href="#local-6989586621681197742"><span class="hs-identifier hs-var">isTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.html#naturalTyCon"><span class="hs-identifier hs-var">naturalTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType -&gt; Bool) -&gt; (Term -&gt; TcType) -&gt; Term -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197726"><span class="hs-identifier hs-var">ppr_natural</span></a></span><span>
</span><span id="line-330"></span><span>  </span><span class="hs-special">]</span><span>
</span><span id="line-331"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-332"></span><span>   </span><span class="annot"><a href="#local-6989586621681197749"><span class="hs-identifier hs-type">ifTerm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span>
</span><span id="line-333"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Precedence"><span class="hs-identifier hs-type">Precedence</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198641"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-334"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Precedence"><span class="hs-identifier hs-type">Precedence</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198641"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-335"></span><span>   </span><span id="local-6989586621681197749"><span class="annot"><span class="annottext">ifTerm :: (Term -&gt; Bool) -&gt; TermPrinterM m -&gt; Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197749"><span class="hs-identifier hs-var hs-var">ifTerm</span></a></span></span><span> </span><span id="local-6989586621681197725"><span class="annot"><span class="annottext">Term -&gt; Bool
</span><a href="#local-6989586621681197725"><span class="hs-identifier hs-var">pred</span></a></span></span><span> </span><span id="local-6989586621681197724"><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197724"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; Bool)
-&gt; (Int -&gt; Term -&gt; m (Maybe SDoc)) -&gt; Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197738"><span class="hs-identifier hs-var">ifTerm'</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; Bool
</span><a href="#local-6989586621681197725"><span class="hs-identifier hs-var">pred</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681197723"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197723"><span class="hs-identifier hs-var">prec</span></a></span></span><span> </span><span id="local-6989586621681197722"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197722"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Maybe SDoc
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; Maybe SDoc) -&gt; m SDoc -&gt; m (Maybe SDoc)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197724"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197723"><span class="hs-identifier hs-var">prec</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197722"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-336"></span><span>
</span><span id="line-337"></span><span>   </span><span class="annot"><a href="#local-6989586621681197738"><span class="hs-identifier hs-type">ifTerm'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span>
</span><span id="line-338"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Precedence"><span class="hs-identifier hs-type">Precedence</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198641"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-339"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Precedence"><span class="hs-identifier hs-type">Precedence</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198641"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-340"></span><span>   </span><span id="local-6989586621681197738"><span class="annot"><span class="annottext">ifTerm' :: (Term -&gt; Bool)
-&gt; (Int -&gt; Term -&gt; m (Maybe SDoc)) -&gt; Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197738"><span class="hs-identifier hs-var hs-var">ifTerm'</span></a></span></span><span> </span><span id="local-6989586621681197720"><span class="annot"><span class="annottext">Term -&gt; Bool
</span><a href="#local-6989586621681197720"><span class="hs-identifier hs-var">pred</span></a></span></span><span> </span><span id="local-6989586621681197719"><span class="annot"><span class="annottext">Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197719"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681197718"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197718"><span class="hs-identifier hs-var">prec</span></a></span></span><span> </span><span id="local-6989586621681197717"><span class="annot"><span class="annottext">t :: Term
</span><a href="#local-6989586621681197717"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>
</span><span id="line-341"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Term -&gt; Bool
</span><a href="#local-6989586621681197720"><span class="hs-identifier hs-var">pred</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197717"><span class="hs-identifier hs-var">t</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197719"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197718"><span class="hs-identifier hs-var">prec</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197717"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-342"></span><span>   </span><span class="annot"><a href="#local-6989586621681197738"><span class="hs-identifier hs-var">ifTerm'</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Term -&gt; m (Maybe SDoc)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Term
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SDoc
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-343"></span><span>
</span><span id="line-344"></span><span>   </span><span id="local-6989586621681197748"><span class="annot"><span class="annottext">isTupleTy :: TcType -&gt; Bool
</span><a href="#local-6989586621681197748"><span class="hs-identifier hs-var hs-var">isTupleTy</span></a></span></span><span> </span><span id="local-6989586621681197712"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197712"><span class="hs-identifier hs-var">ty</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Maybe Bool -&gt; Bool
forall a. a -&gt; Maybe a -&gt; a
</span><a href="../../base/src/Data.Maybe.html#fromMaybe"><span class="hs-identifier hs-var">fromMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">(Maybe Bool -&gt; Bool) -&gt; Maybe Bool -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-345"></span><span>     </span><span class="hs-special">(</span><span id="local-6989586621681197710"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197710"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[TcType]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; TcType -&gt; Maybe (TyCon, [TcType])
TcType -&gt; Maybe (TyCon, [TcType])
</span><a href="GHC.Core.Type.html#tcSplitTyConApp_maybe"><span class="hs-identifier hs-var">tcSplitTyConApp_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197712"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-346"></span><span>     </span><span class="annot"><span class="annottext">Bool -&gt; Maybe Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isBoxedTupleTyCon"><span class="hs-identifier hs-var">isBoxedTupleTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197710"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-347"></span><span>
</span><span id="line-348"></span><span>   </span><span id="local-6989586621681197742"><span class="annot"><span class="annottext">isTyCon :: TyCon -&gt; TcType -&gt; Bool
</span><a href="#local-6989586621681197742"><span class="hs-identifier hs-var hs-var">isTyCon</span></a></span></span><span> </span><span id="local-6989586621681197703"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197703"><span class="hs-identifier hs-var">a_tc</span></a></span></span><span> </span><span id="local-6989586621681197702"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197702"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Maybe Bool -&gt; Bool
forall a. a -&gt; Maybe a -&gt; a
</span><a href="../../base/src/Data.Maybe.html#fromMaybe"><span class="hs-identifier hs-var">fromMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">(Maybe Bool -&gt; Bool) -&gt; Maybe Bool -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-349"></span><span>     </span><span class="hs-special">(</span><span id="local-6989586621681197701"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197701"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[TcType]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; TcType -&gt; Maybe (TyCon, [TcType])
TcType -&gt; Maybe (TyCon, [TcType])
</span><a href="GHC.Core.Type.html#tcSplitTyConApp_maybe"><span class="hs-identifier hs-var">tcSplitTyConApp_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197702"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-350"></span><span>     </span><span class="annot"><span class="annottext">Bool -&gt; Maybe Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197703"><span class="hs-identifier hs-var">a_tc</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197701"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-351"></span><span>
</span><span id="line-352"></span><span>   </span><span class="annot"><a href="#local-6989586621681197736"><span class="hs-identifier hs-type">ppr_int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681197734"><span class="hs-identifier hs-type">ppr_char</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681197732"><span class="hs-identifier hs-type">ppr_float</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681197730"><span class="hs-identifier hs-type">ppr_double</span></a></span><span>
</span><span id="line-353"></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Precedence"><span class="hs-identifier hs-type">Precedence</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198641"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-354"></span><span>   </span><span id="local-6989586621681197736"><span class="annot"><span class="annottext">ppr_int :: Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197736"><span class="hs-identifier hs-var hs-var">ppr_int</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-type">Prim</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">valRaw :: Term -&gt; [Word]
</span><a href="GHC.Runtime.Heap.Inspect.html#valRaw"><span class="hs-identifier hs-var">valRaw</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span id="local-6989586621681197700"><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197700"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">]</span><span class="hs-special">}</span><span class="hs-special">]</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-355"></span><span>      </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; Maybe SDoc
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">Ppr.int</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197700"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-356"></span><span>   </span><span class="annot"><a href="#local-6989586621681197736"><span class="hs-identifier hs-var">ppr_int</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Term
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SDoc
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-357"></span><span>
</span><span id="line-358"></span><span>   </span><span id="local-6989586621681197734"><span class="annot"><span class="annottext">ppr_char :: Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197734"><span class="hs-identifier hs-var hs-var">ppr_char</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-type">Prim</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">valRaw :: Term -&gt; [Word]
</span><a href="GHC.Runtime.Heap.Inspect.html#valRaw"><span class="hs-identifier hs-var">valRaw</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span id="local-6989586621681197698"><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197698"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">]</span><span class="hs-special">}</span><span class="hs-special">]</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-359"></span><span>      </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; Maybe SDoc
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#pprHsChar"><span class="hs-identifier hs-var">Ppr.pprHsChar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Char
</span><a href="../../base/src/GHC.Char.html#chr"><span class="hs-identifier hs-var">chr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197698"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-360"></span><span>   </span><span class="annot"><a href="#local-6989586621681197734"><span class="hs-identifier hs-var">ppr_char</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Term
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SDoc
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-361"></span><span>
</span><span id="line-362"></span><span>   </span><span id="local-6989586621681197732"><span class="annot"><span class="annottext">ppr_float :: Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197732"><span class="hs-identifier hs-var hs-var">ppr_float</span></a></span></span><span>   </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-type">Prim</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">valRaw :: Term -&gt; [Word]
</span><a href="GHC.Runtime.Heap.Inspect.html#valRaw"><span class="hs-identifier hs-var">valRaw</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span id="local-6989586621681197695"><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197695"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">]</span><span class="hs-special">}</span><span class="hs-special">]</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-363"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681197689"><span class="annot"><span class="annottext">f :: Float
</span><a href="#local-6989586621681197689"><span class="hs-identifier hs-var hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO Float -&gt; Float
forall a. IO a -&gt; a
</span><a href="../../base/src/GHC.IO.Unsafe.html#unsafeDupablePerformIO"><span class="hs-identifier hs-var">unsafeDupablePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Float -&gt; Float) -&gt; IO Float -&gt; Float
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-364"></span><span>                </span><span class="annot"><span class="annottext">(Ptr Word -&gt; IO Float) -&gt; IO Float
forall a b. Storable a =&gt; (Ptr a -&gt; IO b) -&gt; IO b
</span><a href="../../base/src/Foreign.Marshal.Alloc.html#alloca"><span class="hs-identifier hs-var">alloca</span></a></span><span> </span><span class="annot"><span class="annottext">((Ptr Word -&gt; IO Float) -&gt; IO Float)
-&gt; (Ptr Word -&gt; IO Float) -&gt; IO Float
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197686"><span class="annot"><span class="annottext">Ptr Word
</span><a href="#local-6989586621681197686"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Ptr Word -&gt; Word -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word
</span><a href="#local-6989586621681197686"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197695"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">IO () -&gt; IO Float -&gt; IO Float
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Float -&gt; IO Float
forall a. Storable a =&gt; Ptr a -&gt; IO a
</span><a href="../../base/src/Foreign.Storable.html#peek"><span class="hs-identifier hs-var">peek</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word -&gt; Ptr Float
forall a b. Ptr a -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#castPtr"><span class="hs-identifier hs-var">castPtr</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word
</span><a href="#local-6989586621681197686"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-365"></span><span>      </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; Maybe SDoc
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Float -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#float"><span class="hs-identifier hs-var">Ppr.float</span></a></span><span> </span><span class="annot"><span class="annottext">Float
</span><a href="#local-6989586621681197689"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-366"></span><span>   </span><span class="annot"><a href="#local-6989586621681197732"><span class="hs-identifier hs-var">ppr_float</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Term
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SDoc
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-367"></span><span>
</span><span id="line-368"></span><span>   </span><span id="local-6989586621681197730"><span class="annot"><span class="annottext">ppr_double :: Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197730"><span class="hs-identifier hs-var hs-var">ppr_double</span></a></span></span><span>  </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-type">Prim</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">valRaw :: Term -&gt; [Word]
</span><a href="GHC.Runtime.Heap.Inspect.html#valRaw"><span class="hs-identifier hs-var">valRaw</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span id="local-6989586621681197681"><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197681"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">]</span><span class="hs-special">}</span><span class="hs-special">]</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-369"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681197675"><span class="annot"><span class="annottext">f :: Double
</span><a href="#local-6989586621681197675"><span class="hs-identifier hs-var hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO Double -&gt; Double
forall a. IO a -&gt; a
</span><a href="../../base/src/GHC.IO.Unsafe.html#unsafeDupablePerformIO"><span class="hs-identifier hs-var">unsafeDupablePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Double -&gt; Double) -&gt; IO Double -&gt; Double
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-370"></span><span>                </span><span class="annot"><span class="annottext">(Ptr Word -&gt; IO Double) -&gt; IO Double
forall a b. Storable a =&gt; (Ptr a -&gt; IO b) -&gt; IO b
</span><a href="../../base/src/Foreign.Marshal.Alloc.html#alloca"><span class="hs-identifier hs-var">alloca</span></a></span><span> </span><span class="annot"><span class="annottext">((Ptr Word -&gt; IO Double) -&gt; IO Double)
-&gt; (Ptr Word -&gt; IO Double) -&gt; IO Double
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197674"><span class="annot"><span class="annottext">Ptr Word
</span><a href="#local-6989586621681197674"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Ptr Word -&gt; Word -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word
</span><a href="#local-6989586621681197674"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197681"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">IO () -&gt; IO Double -&gt; IO Double
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Double -&gt; IO Double
forall a. Storable a =&gt; Ptr a -&gt; IO a
</span><a href="../../base/src/Foreign.Storable.html#peek"><span class="hs-identifier hs-var">peek</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word -&gt; Ptr Double
forall a b. Ptr a -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#castPtr"><span class="hs-identifier hs-var">castPtr</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word
</span><a href="#local-6989586621681197674"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-371"></span><span>      </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; Maybe SDoc
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Double -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#double"><span class="hs-identifier hs-var">Ppr.double</span></a></span><span> </span><span class="annot"><span class="annottext">Double
</span><a href="#local-6989586621681197675"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-372"></span><span>   </span><span class="hs-comment">-- let's assume that if we get two words, we're on a 32-bit</span><span>
</span><span id="line-373"></span><span>   </span><span class="hs-comment">-- machine. There's no good way to get a Platform to check the word</span><span>
</span><span id="line-374"></span><span>   </span><span class="hs-comment">-- size here.</span><span>
</span><span id="line-375"></span><span>   </span><span class="annot"><a href="#local-6989586621681197730"><span class="hs-identifier hs-var">ppr_double</span></a></span><span>  </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-type">Prim</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">valRaw :: Term -&gt; [Word]
</span><a href="GHC.Runtime.Heap.Inspect.html#valRaw"><span class="hs-identifier hs-var">valRaw</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span id="local-6989586621681197672"><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197672"><span class="hs-identifier hs-var">w1</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681197671"><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197671"><span class="hs-identifier hs-var">w2</span></a></span></span><span class="hs-special">]</span><span class="hs-special">}</span><span class="hs-special">]</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-376"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681197658"><span class="annot"><span class="annottext">f :: Double
</span><a href="#local-6989586621681197658"><span class="hs-identifier hs-var hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO Double -&gt; Double
forall a. IO a -&gt; a
</span><a href="../../base/src/GHC.IO.Unsafe.html#unsafeDupablePerformIO"><span class="hs-identifier hs-var">unsafeDupablePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Double -&gt; Double) -&gt; IO Double -&gt; Double
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-377"></span><span>                </span><span class="annot"><span class="annottext">(Ptr Word32 -&gt; IO Double) -&gt; IO Double
forall a b. Storable a =&gt; (Ptr a -&gt; IO b) -&gt; IO b
</span><a href="../../base/src/Foreign.Marshal.Alloc.html#alloca"><span class="hs-identifier hs-var">alloca</span></a></span><span> </span><span class="annot"><span class="annottext">((Ptr Word32 -&gt; IO Double) -&gt; IO Double)
-&gt; (Ptr Word32 -&gt; IO Double) -&gt; IO Double
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197657"><span class="annot"><span class="annottext">Ptr Word32
</span><a href="#local-6989586621681197657"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-378"></span><span>                  </span><span class="annot"><span class="annottext">Ptr Word32 -&gt; Word32 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word32
</span><a href="#local-6989586621681197657"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word -&gt; Word32
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197672"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-379"></span><span>                  </span><span class="annot"><span class="annottext">Ptr Word32 -&gt; Word32 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word32
</span><a href="#local-6989586621681197657"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word32 -&gt; Int -&gt; Ptr Word32
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word -&gt; Word32
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197671"><span class="hs-identifier hs-var">w2</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-380"></span><span>                  </span><span class="annot"><span class="annottext">Ptr Double -&gt; IO Double
forall a. Storable a =&gt; Ptr a -&gt; IO a
</span><a href="../../base/src/Foreign.Storable.html#peek"><span class="hs-identifier hs-var">peek</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word32 -&gt; Ptr Double
forall a b. Ptr a -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#castPtr"><span class="hs-identifier hs-var">castPtr</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word32
</span><a href="#local-6989586621681197657"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-381"></span><span>      </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; Maybe SDoc
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Double -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#double"><span class="hs-identifier hs-var">Ppr.double</span></a></span><span> </span><span class="annot"><span class="annottext">Double
</span><a href="#local-6989586621681197658"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-382"></span><span>   </span><span class="annot"><a href="#local-6989586621681197730"><span class="hs-identifier hs-var">ppr_double</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Term
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SDoc
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-383"></span><span>
</span><span id="line-384"></span><span>   </span><span class="annot"><a href="#local-6989586621681197655"><span class="hs-identifier hs-type">ppr_bignat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Precedence"><span class="hs-identifier hs-type">Precedence</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Word</span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198641"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-385"></span><span>   </span><span id="local-6989586621681197655"><span class="annot"><span class="annottext">ppr_bignat :: Bool -&gt; Int -&gt; [Word] -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197655"><span class="hs-identifier hs-var hs-var">ppr_bignat</span></a></span></span><span> </span><span id="local-6989586621681197654"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681197654"><span class="hs-identifier hs-var">sign</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681197653"><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197653"><span class="hs-identifier hs-var">ws</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-386"></span><span>      </span><span class="hs-keyword">let</span><span>
</span><span id="line-387"></span><span>         </span><span id="local-6989586621681197650"><span class="annot"><span class="annottext">wordSize :: Int
</span><a href="#local-6989586621681197650"><span class="hs-identifier hs-var hs-var">wordSize</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word -&gt; Int
forall b. FiniteBits b =&gt; b -&gt; Int
</span><a href="../../base/src/Data.Bits.html#finiteBitSize"><span class="hs-identifier hs-var">finiteBitSize</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Word</span></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- does the word size depend on the target?</span><span>
</span><span id="line-388"></span><span>         </span><span id="local-6989586621681197640"><span class="annot"><span class="annottext">makeInteger :: t -&gt; Int -&gt; [a] -&gt; t
</span><a href="#local-6989586621681197640"><span class="hs-identifier hs-var hs-var">makeInteger</span></a></span></span><span> </span><span id="local-6989586621681197639"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681197639"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681197639"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-389"></span><span>         </span><span class="annot"><a href="#local-6989586621681197640"><span class="hs-identifier hs-var">makeInteger</span></a></span><span> </span><span id="local-6989586621681197638"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681197638"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621681197637"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197637"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197636"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681197636"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681197635"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681197635"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">t -&gt; Int -&gt; [a] -&gt; t
</span><a href="#local-6989586621681197640"><span class="hs-identifier hs-var">makeInteger</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681197638"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">t -&gt; t -&gt; t
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; t
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681197636"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">t -&gt; Int -&gt; t
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftL"><span class="hs-operator hs-var">`shiftL`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197637"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197637"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197650"><span class="hs-identifier hs-var">wordSize</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681197635"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-390"></span><span>         </span><span id="local-6989586621681197630"><span class="annot"><span class="annottext">signf :: Integer
</span><a href="#local-6989586621681197630"><span class="hs-identifier hs-var hs-var">signf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681197654"><span class="hs-identifier hs-var">sign</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-391"></span><span>                  </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span>
</span><span id="line-392"></span><span>                  </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span>
</span><span id="line-393"></span><span>      </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe SDoc -&gt; m (Maybe SDoc)) -&gt; Maybe SDoc -&gt; m (Maybe SDoc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Maybe SDoc
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; Maybe SDoc) -&gt; SDoc -&gt; Maybe SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#integer"><span class="hs-identifier hs-var">Ppr.integer</span></a></span><span> </span><span class="annot"><span class="annottext">(Integer -&gt; SDoc) -&gt; Integer -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681197630"><span class="hs-identifier hs-var">signf</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Int -&gt; [Word] -&gt; Integer
forall {t} {a}. (Bits t, Integral a, Num t) =&gt; t -&gt; Int -&gt; [a] -&gt; t
</span><a href="#local-6989586621681197640"><span class="hs-identifier hs-var">makeInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197653"><span class="hs-identifier hs-var">ws</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-394"></span><span>
</span><span id="line-395"></span><span>   </span><span class="hs-comment">-- Reconstructing Bignums is a bit of a pain. This depends deeply on their</span><span>
</span><span id="line-396"></span><span>   </span><span class="hs-comment">-- representation, so it'll break if that changes (but there are several</span><span>
</span><span id="line-397"></span><span>   </span><span class="hs-comment">-- tests in tests/ghci.debugger/scripts that will tell us if this is wrong).</span><span>
</span><span id="line-398"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-399"></span><span>   </span><span class="hs-comment">--   data Integer</span><span>
</span><span id="line-400"></span><span>   </span><span class="hs-comment">--     = IS !Int#</span><span>
</span><span id="line-401"></span><span>   </span><span class="hs-comment">--     | IP !BigNat</span><span>
</span><span id="line-402"></span><span>   </span><span class="hs-comment">--     | IN !BigNat</span><span>
</span><span id="line-403"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-404"></span><span>   </span><span class="hs-comment">--   data Natural</span><span>
</span><span id="line-405"></span><span>   </span><span class="hs-comment">--     = NS !Word#</span><span>
</span><span id="line-406"></span><span>   </span><span class="hs-comment">--     | NB !BigNat</span><span>
</span><span id="line-407"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-408"></span><span>   </span><span class="hs-comment">--   type BigNat = ByteArray#</span><span>
</span><span id="line-409"></span><span>
</span><span id="line-410"></span><span>   </span><span class="annot"><a href="#local-6989586621681197728"><span class="hs-identifier hs-type">ppr_integer</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Precedence"><span class="hs-identifier hs-type">Precedence</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198641"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-411"></span><span>   </span><span id="local-6989586621681197728"><span class="annot"><span class="annottext">ppr_integer :: Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197728"><span class="hs-identifier hs-var hs-var">ppr_integer</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">dc :: Term -&gt; Either String DataCon
</span><a href="GHC.Runtime.Heap.Inspect.html#dc"><span class="hs-identifier hs-var">dc</span></a></span><span class="hs-glyph">=</span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681197627"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197627"><span class="hs-identifier hs-var">con</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-type">Prim</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">valRaw :: Term -&gt; [Word]
</span><a href="GHC.Runtime.Heap.Inspect.html#valRaw"><span class="hs-identifier hs-var">valRaw</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197626"><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197626"><span class="hs-identifier hs-var">ws</span></a></span></span><span class="hs-special">}</span><span class="hs-special">]</span><span class="hs-special">}</span><span>
</span><span id="line-412"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197627"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; DataCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#integerISDataCon"><span class="hs-identifier hs-var">integerISDataCon</span></a></span><span>
</span><span id="line-413"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">W#</span></span><span> </span><span id="local-6989586621681197624"><span class="annot"><span class="annottext">Word#
</span><a href="#local-6989586621681197624"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197626"><span class="hs-identifier hs-var">ws</span></a></span><span>
</span><span id="line-414"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; Maybe SDoc
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#integer"><span class="hs-identifier hs-var">Ppr.integer</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><span class="hs-identifier hs-var">I#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word# -&gt; Int#
</span><span class="hs-identifier hs-var">word2Int#</span></span><span> </span><span class="annot"><span class="annottext">Word#
</span><a href="#local-6989586621681197624"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-415"></span><span>   </span><span class="annot"><a href="#local-6989586621681197728"><span class="hs-identifier hs-var">ppr_integer</span></a></span><span> </span><span id="local-6989586621681197623"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197623"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">dc :: Term -&gt; Either String DataCon
</span><a href="GHC.Runtime.Heap.Inspect.html#dc"><span class="hs-identifier hs-var">dc</span></a></span><span class="hs-glyph">=</span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681197622"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197622"><span class="hs-identifier hs-var">con</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-type">Prim</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">valRaw :: Term -&gt; [Word]
</span><a href="GHC.Runtime.Heap.Inspect.html#valRaw"><span class="hs-identifier hs-var">valRaw</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197621"><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197621"><span class="hs-identifier hs-var">ws</span></a></span></span><span class="hs-special">}</span><span class="hs-special">]</span><span class="hs-special">}</span><span class="hs-special">]</span><span class="hs-special">}</span><span>
</span><span id="line-416"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197622"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; DataCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#integerIPDataCon"><span class="hs-identifier hs-var">integerIPDataCon</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; [Word] -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197655"><span class="hs-identifier hs-var">ppr_bignat</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197623"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197621"><span class="hs-identifier hs-var">ws</span></a></span><span>
</span><span id="line-417"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197622"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; DataCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#integerINDataCon"><span class="hs-identifier hs-var">integerINDataCon</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; [Word] -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197655"><span class="hs-identifier hs-var">ppr_bignat</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>  </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197623"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197621"><span class="hs-identifier hs-var">ws</span></a></span><span>
</span><span id="line-418"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; m (Maybe SDoc)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Unexpected Integer constructor&quot;</span></span><span>
</span><span id="line-419"></span><span>   </span><span class="annot"><a href="#local-6989586621681197728"><span class="hs-identifier hs-var">ppr_integer</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Term
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SDoc
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-420"></span><span>
</span><span id="line-421"></span><span>   </span><span class="annot"><a href="#local-6989586621681197726"><span class="hs-identifier hs-type">ppr_natural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Precedence"><span class="hs-identifier hs-type">Precedence</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198641"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-422"></span><span>   </span><span id="local-6989586621681197726"><span class="annot"><span class="annottext">ppr_natural :: Int -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197726"><span class="hs-identifier hs-var hs-var">ppr_natural</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">dc :: Term -&gt; Either String DataCon
</span><a href="GHC.Runtime.Heap.Inspect.html#dc"><span class="hs-identifier hs-var">dc</span></a></span><span class="hs-glyph">=</span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681197618"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197618"><span class="hs-identifier hs-var">con</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-type">Prim</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">valRaw :: Term -&gt; [Word]
</span><a href="GHC.Runtime.Heap.Inspect.html#valRaw"><span class="hs-identifier hs-var">valRaw</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197617"><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197617"><span class="hs-identifier hs-var">ws</span></a></span></span><span class="hs-special">}</span><span class="hs-special">]</span><span class="hs-special">}</span><span>
</span><span id="line-423"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197618"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; DataCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#naturalNSDataCon"><span class="hs-identifier hs-var">naturalNSDataCon</span></a></span><span>
</span><span id="line-424"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681197615"><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197615"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197617"><span class="hs-identifier hs-var">ws</span></a></span><span>
</span><span id="line-425"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; Maybe SDoc
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#integer"><span class="hs-identifier hs-var">Ppr.integer</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197615"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-426"></span><span>   </span><span class="annot"><a href="#local-6989586621681197726"><span class="hs-identifier hs-var">ppr_natural</span></a></span><span> </span><span id="local-6989586621681197614"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197614"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">dc :: Term -&gt; Either String DataCon
</span><a href="GHC.Runtime.Heap.Inspect.html#dc"><span class="hs-identifier hs-var">dc</span></a></span><span class="hs-glyph">=</span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681197613"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197613"><span class="hs-identifier hs-var">con</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-type">Prim</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">valRaw :: Term -&gt; [Word]
</span><a href="GHC.Runtime.Heap.Inspect.html#valRaw"><span class="hs-identifier hs-var">valRaw</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197612"><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197612"><span class="hs-identifier hs-var">ws</span></a></span></span><span class="hs-special">}</span><span class="hs-special">]</span><span class="hs-special">}</span><span class="hs-special">]</span><span class="hs-special">}</span><span>
</span><span id="line-427"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197613"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; DataCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#naturalNBDataCon"><span class="hs-identifier hs-var">naturalNBDataCon</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; [Word] -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681197655"><span class="hs-identifier hs-var">ppr_bignat</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197614"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197612"><span class="hs-identifier hs-var">ws</span></a></span><span>
</span><span id="line-428"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; m (Maybe SDoc)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Unexpected Natural constructor&quot;</span></span><span>
</span><span id="line-429"></span><span>   </span><span class="annot"><a href="#local-6989586621681197726"><span class="hs-identifier hs-var">ppr_natural</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Term
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SDoc
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-430"></span><span>
</span><span id="line-431"></span><span>   </span><span class="hs-comment">--Note pprinting of list terms is not lazy</span><span>
</span><span id="line-432"></span><span>   </span><span class="annot"><a href="#local-6989586621681197739"><span class="hs-identifier hs-type">ppr_list</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Precedence"><span class="hs-identifier hs-type">Precedence</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681198641"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-433"></span><span>   </span><span id="local-6989586621681197739"><span class="annot"><span class="annottext">ppr_list :: TermPrinterM m
</span><a href="#local-6989586621681197739"><span class="hs-identifier hs-var hs-var">ppr_list</span></a></span></span><span> </span><span id="local-6989586621681197610"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197610"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span id="local-6989586621681197609"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197609"><span class="hs-identifier hs-var">h</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681197608"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197608"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">]</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-434"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681197607"><span class="annot"><span class="annottext">elems :: [Term]
</span><a href="#local-6989586621681197607"><span class="hs-identifier hs-var hs-var">elems</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197609"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; [Term] -&gt; [Term]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Term -&gt; [Term]
</span><a href="#local-6989586621681197606"><span class="hs-identifier hs-var">getListTerms</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197608"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-435"></span><span>           </span><span id="local-6989586621681197605"><span class="annot"><span class="annottext">isConsLast :: Bool
</span><a href="#local-6989586621681197605"><span class="hs-identifier hs-var hs-var">isConsLast</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#termType"><span class="hs-identifier hs-var">termType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Term] -&gt; Term
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#last"><span class="hs-identifier hs-var">last</span></a></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197607"><span class="hs-identifier hs-var">elems</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-operator hs-var">`eqType`</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#termType"><span class="hs-identifier hs-var">termType</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197609"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-436"></span><span>           </span><span id="local-6989586621681197601"><span class="annot"><span class="annottext">is_string :: Bool
</span><a href="#local-6989586621681197601"><span class="hs-identifier hs-var hs-var">is_string</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; Bool) -&gt; [Term] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; Bool
</span><a href="GHC.Tc.Utils.TcType.html#isCharTy"><span class="hs-identifier hs-var">isCharTy</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType -&gt; Bool) -&gt; (Term -&gt; TcType) -&gt; Term -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197607"><span class="hs-identifier hs-var">elems</span></a></span><span>
</span><span id="line-437"></span><span>           </span><span id="local-6989586621681197597"><span class="annot"><span class="annottext">chars :: String
</span><a href="#local-6989586621681197597"><span class="hs-identifier hs-var hs-var">chars</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char
</span><a href="../../base/src/GHC.Char.html#chr"><span class="hs-identifier hs-var">chr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197596"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-438"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-type">Prim</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">valRaw :: Term -&gt; [Word]
</span><a href="GHC.Runtime.Heap.Inspect.html#valRaw"><span class="hs-identifier hs-var">valRaw</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span id="local-6989586621681197596"><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197596"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">]</span><span class="hs-special">}</span><span class="hs-special">]</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197607"><span class="hs-identifier hs-var">elems</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-439"></span><span>
</span><span id="line-440"></span><span>       </span><span id="local-6989586621681197595"><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681197595"><span class="hs-identifier hs-var">print_elems</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; m SDoc) -&gt; [Term] -&gt; m [SDoc]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681197750"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Runtime.Heap.Inspect.html#cons_prec"><span class="hs-identifier hs-var">cons_prec</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197607"><span class="hs-identifier hs-var">elems</span></a></span><span>
</span><span id="line-441"></span><span>       </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681197601"><span class="hs-identifier hs-var">is_string</span></a></span><span>
</span><span id="line-442"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; m SDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#doubleQuotes"><span class="hs-identifier hs-var">Ppr.doubleQuotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">Ppr.text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681197597"><span class="hs-identifier hs-var">chars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-443"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681197605"><span class="hs-identifier hs-var">isConsLast</span></a></span><span>
</span><span id="line-444"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; m SDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; m SDoc) -&gt; SDoc -&gt; m SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#cparen"><span class="hs-identifier hs-var">cparen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197610"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Runtime.Heap.Inspect.html#cons_prec"><span class="hs-identifier hs-var">cons_prec</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-445"></span><span>                    </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; SDoc -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#pprDeeperList"><span class="hs-identifier hs-var">pprDeeperList</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#fsep"><span class="hs-identifier hs-var">fsep</span></a></span><span>
</span><span id="line-446"></span><span>                    </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; [SDoc] -&gt; [SDoc]
</span><a href="GHC.Utils.Outputable.html#punctuate"><span class="hs-identifier hs-var">punctuate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#space"><span class="hs-identifier hs-var">space</span></a></span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681197595"><span class="hs-identifier hs-var">print_elems</span></a></span><span>
</span><span id="line-447"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; m SDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; m SDoc) -&gt; SDoc -&gt; m SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#brackets"><span class="hs-identifier hs-var">brackets</span></a></span><span>
</span><span id="line-448"></span><span>                    </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; SDoc -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#pprDeeperList"><span class="hs-identifier hs-var">pprDeeperList</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#fcat"><span class="hs-identifier hs-var">fcat</span></a></span><span>
</span><span id="line-449"></span><span>                    </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; [SDoc] -&gt; [SDoc]
</span><a href="GHC.Utils.Outputable.html#punctuate"><span class="hs-identifier hs-var">punctuate</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#comma"><span class="hs-identifier hs-var">comma</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681197595"><span class="hs-identifier hs-var">print_elems</span></a></span><span>
</span><span id="line-450"></span><span>
</span><span id="line-451"></span><span>        </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681197606"><span class="annot"><span class="annottext">getListTerms :: Term -&gt; [Term]
</span><a href="#local-6989586621681197606"><span class="hs-identifier hs-var hs-var">getListTerms</span></a></span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span id="local-6989586621681197586"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197586"><span class="hs-identifier hs-var">h</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681197585"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197585"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">]</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197586"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; [Term] -&gt; [Term]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Term -&gt; [Term]
</span><a href="#local-6989586621681197606"><span class="hs-identifier hs-var">getListTerms</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197585"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-452"></span><span>              </span><span class="annot"><a href="#local-6989586621681197606"><span class="hs-identifier hs-var">getListTerms</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">subTerms :: Term -&gt; [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#subTerms"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">}</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-453"></span><span>              </span><span class="annot"><a href="#local-6989586621681197606"><span class="hs-identifier hs-var">getListTerms</span></a></span><span> </span><span id="local-6989586621681197584"><span class="annot"><span class="annottext">t :: Term
</span><a href="#local-6989586621681197584"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-type">Suspension</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197584"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-454"></span><span>              </span><span class="annot"><a href="#local-6989586621681197606"><span class="hs-identifier hs-var">getListTerms</span></a></span><span> </span><span id="local-6989586621681197583"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197583"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; [Term]
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;getListTerms&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Term -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197583"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-455"></span><span>   </span><span class="annot"><a href="#local-6989586621681197739"><span class="hs-identifier hs-var">ppr_list</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Term
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; m SDoc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;doList&quot;</span></span><span>
</span><span id="line-456"></span><span>
</span><span id="line-457"></span><span>
</span><span id="line-458"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#repPrim"><span class="hs-identifier hs-type">repPrim</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Word</span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-459"></span><span id="repPrim"><span class="annot"><span class="annottext">repPrim :: TyCon -&gt; [Word] -&gt; SDoc
</span><a href="GHC.Runtime.Heap.Inspect.html#repPrim"><span class="hs-identifier hs-var hs-var">repPrim</span></a></span></span><span> </span><span id="local-6989586621681197581"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Word] -&gt; SDoc
forall {a}. Storable a =&gt; [a] -&gt; SDoc
</span><a href="#local-6989586621681197580"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-460"></span><span>   </span><span id="local-6989586621681197580"><span class="annot"><span class="annottext">rep :: [a] -&gt; SDoc
</span><a href="#local-6989586621681197580"><span class="hs-identifier hs-var hs-var">rep</span></a></span></span><span> </span><span id="local-6989586621681197507"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681197507"><span class="hs-identifier hs-var">x</span></a></span></span><span>
</span><span id="line-461"></span><span>    </span><span class="hs-comment">-- Char# uses native machine words, whereas Char's Storable instance uses</span><span>
</span><span id="line-462"></span><span>    </span><span class="hs-comment">-- Int32, so we have to read it as an Int.</span><span>
</span><span id="line-463"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#charPrimTyCon"><span class="hs-identifier hs-var">charPrimTyCon</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; SDoc) -&gt; String -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Char
</span><a href="../../base/src/GHC.Char.html#chr"><span class="hs-identifier hs-var">chr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; Int
forall {a} {a}. (Storable a, Storable a) =&gt; [a] -&gt; a
</span><a href="#local-6989586621681197505"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681197507"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-464"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#intPrimTyCon"><span class="hs-identifier hs-var">intPrimTyCon</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; SDoc) -&gt; String -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; Int
forall {a} {a}. (Storable a, Storable a) =&gt; [a] -&gt; a
</span><a href="#local-6989586621681197505"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681197507"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-465"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#wordPrimTyCon"><span class="hs-identifier hs-var">wordPrimTyCon</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; SDoc) -&gt; String -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Word -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; Word
forall {a} {a}. (Storable a, Storable a) =&gt; [a] -&gt; a
</span><a href="#local-6989586621681197505"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681197507"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Word</span></span><span class="hs-special">)</span><span>
</span><span id="line-466"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#floatPrimTyCon"><span class="hs-identifier hs-var">floatPrimTyCon</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; SDoc) -&gt; String -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Float -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; Float
forall {a} {a}. (Storable a, Storable a) =&gt; [a] -&gt; a
</span><a href="#local-6989586621681197505"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681197507"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Float</span></span><span class="hs-special">)</span><span>
</span><span id="line-467"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#doublePrimTyCon"><span class="hs-identifier hs-var">doublePrimTyCon</span></a></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; SDoc) -&gt; String -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Double -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; Double
forall {a} {a}. (Storable a, Storable a) =&gt; [a] -&gt; a
</span><a href="#local-6989586621681197505"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681197507"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Double</span></span><span class="hs-special">)</span><span>
</span><span id="line-468"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#int32PrimTyCon"><span class="hs-identifier hs-var">int32PrimTyCon</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; SDoc) -&gt; String -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Int32 -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; Int32
forall {a} {a}. (Storable a, Storable a) =&gt; [a] -&gt; a
</span><a href="#local-6989586621681197505"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681197507"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int32"><span class="hs-identifier hs-type">Int32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-469"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#word32PrimTyCon"><span class="hs-identifier hs-var">word32PrimTyCon</span></a></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; SDoc) -&gt; String -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; Word32
forall {a} {a}. (Storable a, Storable a) =&gt; [a] -&gt; a
</span><a href="#local-6989586621681197505"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681197507"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-470"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#int64PrimTyCon"><span class="hs-identifier hs-var">int64PrimTyCon</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; SDoc) -&gt; String -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; Int64
forall {a} {a}. (Storable a, Storable a) =&gt; [a] -&gt; a
</span><a href="#local-6989586621681197505"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681197507"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-471"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#word64PrimTyCon"><span class="hs-identifier hs-var">word64PrimTyCon</span></a></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; SDoc) -&gt; String -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Word64 -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; Word64
forall {a} {a}. (Storable a, Storable a) =&gt; [a] -&gt; a
</span><a href="#local-6989586621681197505"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681197507"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-472"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#addrPrimTyCon"><span class="hs-identifier hs-var">addrPrimTyCon</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; SDoc) -&gt; String -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Any -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Any
forall a. Ptr a
</span><a href="../../base/src/GHC.Ptr.html#nullPtr"><span class="hs-identifier hs-var">nullPtr</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Any -&gt; Int -&gt; Ptr Any
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; Int
forall {a} {a}. (Storable a, Storable a) =&gt; [a] -&gt; a
</span><a href="#local-6989586621681197505"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681197507"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-473"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#stablePtrPrimTyCon"><span class="hs-identifier hs-var">stablePtrPrimTyCon</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;stablePtr&gt;&quot;</span></span><span>
</span><span id="line-474"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#stableNamePrimTyCon"><span class="hs-identifier hs-var">stableNamePrimTyCon</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;stableName&gt;&quot;</span></span><span>
</span><span id="line-475"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#statePrimTyCon"><span class="hs-identifier hs-var">statePrimTyCon</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;statethread&gt;&quot;</span></span><span>
</span><span id="line-476"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#proxyPrimTyCon"><span class="hs-identifier hs-var">proxyPrimTyCon</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;proxy&gt;&quot;</span></span><span>
</span><span id="line-477"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#realWorldTyCon"><span class="hs-identifier hs-var">realWorldTyCon</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;realworld&gt;&quot;</span></span><span>
</span><span id="line-478"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#threadIdPrimTyCon"><span class="hs-identifier hs-var">threadIdPrimTyCon</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;ThreadId&gt;&quot;</span></span><span>
</span><span id="line-479"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#weakPrimTyCon"><span class="hs-identifier hs-var">weakPrimTyCon</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;Weak&gt;&quot;</span></span><span>
</span><span id="line-480"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#arrayPrimTyCon"><span class="hs-identifier hs-var">arrayPrimTyCon</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;array&gt;&quot;</span></span><span>
</span><span id="line-481"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#smallArrayPrimTyCon"><span class="hs-identifier hs-var">smallArrayPrimTyCon</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;smallArray&gt;&quot;</span></span><span>
</span><span id="line-482"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#byteArrayPrimTyCon"><span class="hs-identifier hs-var">byteArrayPrimTyCon</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;bytearray&gt;&quot;</span></span><span>
</span><span id="line-483"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#mutableArrayPrimTyCon"><span class="hs-identifier hs-var">mutableArrayPrimTyCon</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;mutableArray&gt;&quot;</span></span><span>
</span><span id="line-484"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#smallMutableArrayPrimTyCon"><span class="hs-identifier hs-var">smallMutableArrayPrimTyCon</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;smallMutableArray&gt;&quot;</span></span><span>
</span><span id="line-485"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#mutableByteArrayPrimTyCon"><span class="hs-identifier hs-var">mutableByteArrayPrimTyCon</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;mutableByteArray&gt;&quot;</span></span><span>
</span><span id="line-486"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#mutVarPrimTyCon"><span class="hs-identifier hs-var">mutVarPrimTyCon</span></a></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;mutVar&gt;&quot;</span></span><span>
</span><span id="line-487"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#mVarPrimTyCon"><span class="hs-identifier hs-var">mVarPrimTyCon</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;mVar&gt;&quot;</span></span><span>
</span><span id="line-488"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#tVarPrimTyCon"><span class="hs-identifier hs-var">tVarPrimTyCon</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;tVar&gt;&quot;</span></span><span>
</span><span id="line-489"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&lt;'</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197581"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&gt;'</span></span><span>
</span><span id="line-490"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681197505"><span class="annot"><span class="annottext">build :: [a] -&gt; a
</span><a href="#local-6989586621681197505"><span class="hs-identifier hs-var hs-var">build</span></a></span></span><span> </span><span id="local-6989586621681197474"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681197474"><span class="hs-identifier hs-var">ww</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; a
forall a. IO a -&gt; a
</span><a href="../../base/src/GHC.IO.Unsafe.html#unsafePerformIO"><span class="hs-identifier hs-var">unsafePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO a -&gt; a) -&gt; IO a -&gt; a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; (Ptr a -&gt; IO a) -&gt; IO a
forall a b. Storable a =&gt; [a] -&gt; (Ptr a -&gt; IO b) -&gt; IO b
</span><a href="../../base/src/Foreign.Marshal.Array.html#withArray"><span class="hs-identifier hs-var">withArray</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681197474"><span class="hs-identifier hs-var">ww</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr a -&gt; IO a
forall a. Storable a =&gt; Ptr a -&gt; IO a
</span><a href="../../base/src/Foreign.Storable.html#peek"><span class="hs-identifier hs-var">peek</span></a></span><span> </span><span class="annot"><span class="annottext">(Ptr a -&gt; IO a) -&gt; (Ptr a -&gt; Ptr a) -&gt; Ptr a -&gt; IO a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr a -&gt; Ptr a
forall a b. Ptr a -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#castPtr"><span class="hs-identifier hs-var">castPtr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-491"></span><span class="hs-comment">--   This ^^^ relies on the representation of Haskell heap values being</span><span>
</span><span id="line-492"></span><span class="hs-comment">--   the same as in a C array.</span><span>
</span><span id="line-493"></span><span>
</span><span id="line-494"></span><span class="hs-comment">-----------------------------------</span><span>
</span><span id="line-495"></span><span class="hs-comment">-- Type Reconstruction</span><span>
</span><span id="line-496"></span><span class="hs-comment">-----------------------------------</span><span>
</span><span id="line-497"></span><span class="hs-comment">{-
Type Reconstruction is type inference done on heap closures.
The algorithm walks the heap generating a set of equations, which
are solved with syntactic unification.
A type reconstruction equation looks like:

  &lt;datacon reptype&gt;  =  &lt;actual heap contents&gt;

The full equation set is generated by traversing all the subterms, starting
from a given term.

The only difficult part is that newtypes are only found in the lhs of equations.
Right hand sides are missing them. We can either (a) drop them from the lhs, or
(b) reconstruct them in the rhs when possible.

The function congruenceNewtypes takes a shot at (b)
-}</span><span>
</span><span id="line-514"></span><span>
</span><span id="line-515"></span><span>
</span><span id="line-516"></span><span class="hs-comment">-- A (non-mutable) tau type containing</span><span>
</span><span id="line-517"></span><span class="hs-comment">-- existentially quantified tyvars.</span><span>
</span><span id="line-518"></span><span class="hs-comment">--    (since GHC type language currently does not support</span><span>
</span><span id="line-519"></span><span class="hs-comment">--     existentials, we leave these variables unquantified)</span><span>
</span><span id="line-520"></span><span class="hs-keyword">type</span><span> </span><span id="RttiType"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-var">RttiType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-521"></span><span>
</span><span id="line-522"></span><span class="hs-comment">-- An incomplete type as stored in GHCi:</span><span>
</span><span id="line-523"></span><span class="hs-comment">--  no polymorphism: no quantifiers &amp; all tyvars are skolem.</span><span>
</span><span id="line-524"></span><span class="hs-keyword">type</span><span> </span><span id="GhciType"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#GhciType"><span class="hs-identifier hs-var">GhciType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-525"></span><span>
</span><span id="line-526"></span><span>
</span><span id="line-527"></span><span class="hs-comment">-- The Type Reconstruction monad</span><span>
</span><span id="line-528"></span><span class="hs-comment">--------------------------------</span><span>
</span><span id="line-529"></span><span class="hs-keyword">type</span><span> </span><span id="TR"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-var">TR</span></a></span></span><span> </span><span id="local-6989586621681197470"><span class="annot"><a href="#local-6989586621681197470"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681197470"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-530"></span><span>
</span><span id="line-531"></span><span id="local-6989586621681198513"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#runTR"><span class="hs-identifier hs-type">runTR</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198513"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681198513"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-532"></span><span id="runTR"><span class="annot"><span class="annottext">runTR :: forall a. HscEnv -&gt; TR a -&gt; IO a
</span><a href="GHC.Runtime.Heap.Inspect.html#runTR"><span class="hs-identifier hs-var hs-var">runTR</span></a></span></span><span> </span><span id="local-6989586621681197464"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197464"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681197463"><span class="annot"><span class="annottext">TR a
</span><a href="#local-6989586621681197463"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-533"></span><span>  </span><span id="local-6989586621681197462"><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621681197462"><span class="hs-identifier hs-var">mb_val</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; TR a -&gt; IO (Maybe a)
forall a. HscEnv -&gt; TR a -&gt; IO (Maybe a)
</span><a href="GHC.Runtime.Heap.Inspect.html#runTR_maybe"><span class="hs-identifier hs-var">runTR_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197464"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">TR a
</span><a href="#local-6989586621681197463"><span class="hs-identifier hs-var">thing</span></a></span><span>
</span><span id="line-534"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621681197462"><span class="hs-identifier hs-var">mb_val</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-535"></span><span>    </span><span class="annot"><span class="annottext">Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;unable to :print the term&quot;</span></span><span>
</span><span id="line-536"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681197459"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681197459"><span class="hs-identifier hs-var">x</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; IO a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681197459"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-537"></span><span>
</span><span id="line-538"></span><span id="local-6989586621681198510"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#runTR_maybe"><span class="hs-identifier hs-type">runTR_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198510"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198510"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-539"></span><span id="runTR_maybe"><span class="annot"><span class="annottext">runTR_maybe :: forall a. HscEnv -&gt; TR a -&gt; IO (Maybe a)
</span><a href="GHC.Runtime.Heap.Inspect.html#runTR_maybe"><span class="hs-identifier hs-var hs-var">runTR_maybe</span></a></span></span><span> </span><span id="local-6989586621681197456"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197456"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681197455"><span class="annot"><span class="annottext">TR a
</span><a href="#local-6989586621681197455"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-540"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197454"><span class="annot"><span class="annottext">Messages
</span><a href="#local-6989586621681197454"><span class="hs-identifier hs-var">_errs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197453"><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621681197453"><span class="hs-identifier hs-var">res</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; TR a -&gt; IO (Messages, Maybe a)
forall a. HscEnv -&gt; TcM a -&gt; IO (Messages, Maybe a)
</span><a href="GHC.Tc.Utils.Monad.html#initTcInteractive"><span class="hs-identifier hs-var">initTcInteractive</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197456"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">TR a
</span><a href="#local-6989586621681197455"><span class="hs-identifier hs-var">thing_inside</span></a></span><span>
</span><span id="line-541"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe a -&gt; IO (Maybe a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621681197453"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-542"></span><span>
</span><span id="line-543"></span><span class="hs-comment">-- | Term Reconstruction trace</span><span>
</span><span id="line-544"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-type">traceTR</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-545"></span><span id="traceTR"><span class="annot"><span class="annottext">traceTR :: SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var hs-var">traceTR</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TR () -&gt; TR ()
forall a. TcM a -&gt; TcM a
</span><a href="GHC.Runtime.Heap.Inspect.html#liftTcM"><span class="hs-identifier hs-var">liftTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TR () -&gt; TR ()) -&gt; (SDoc -&gt; TR ()) -&gt; SDoc -&gt; TR ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag -&gt; SDoc -&gt; TR ()
</span><a href="GHC.Tc.Utils.Monad.html#traceOptTcRn"><span class="hs-identifier hs-var">traceOptTcRn</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_rtti"><span class="hs-identifier hs-var">Opt_D_dump_rtti</span></a></span><span>
</span><span id="line-546"></span><span>
</span><span id="line-547"></span><span>
</span><span id="line-548"></span><span class="hs-comment">-- Semantically different to recoverM in GHC.Tc.Utils.Monad</span><span>
</span><span id="line-549"></span><span class="hs-comment">-- recoverM retains the errors in the first action,</span><span>
</span><span id="line-550"></span><span class="hs-comment">--  whereas recoverTc here does not</span><span>
</span><span id="line-551"></span><span id="local-6989586621681198501"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#recoverTR"><span class="hs-identifier hs-type">recoverTR</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198501"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198501"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198501"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-552"></span><span id="recoverTR"><span class="annot"><span class="annottext">recoverTR :: forall a. TR a -&gt; TR a -&gt; TR a
</span><a href="GHC.Runtime.Heap.Inspect.html#recoverTR"><span class="hs-identifier hs-var hs-var">recoverTR</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM a -&gt; TcM a -&gt; TcM a
forall a. TR a -&gt; TR a -&gt; TR a
</span><a href="GHC.Tc.Utils.Monad.html#tryTcDiscardingErrs"><span class="hs-identifier hs-var">tryTcDiscardingErrs</span></a></span><span>
</span><span id="line-553"></span><span>
</span><span id="line-554"></span><span id="local-6989586621681198499"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#trIO"><span class="hs-identifier hs-type">trIO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681198499"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198499"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-555"></span><span id="trIO"><span class="annot"><span class="annottext">trIO :: forall a. IO a -&gt; TR a
</span><a href="GHC.Runtime.Heap.Inspect.html#trIO"><span class="hs-identifier hs-var hs-var">trIO</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM a -&gt; TcM a
forall a. TcM a -&gt; TcM a
</span><a href="GHC.Runtime.Heap.Inspect.html#liftTcM"><span class="hs-identifier hs-var">liftTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM a -&gt; TcM a) -&gt; (IO a -&gt; TcM a) -&gt; IO a -&gt; TcM a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">IO a -&gt; TcM a
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span>
</span><span id="line-556"></span><span>
</span><span id="line-557"></span><span id="local-6989586621681198503"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#liftTcM"><span class="hs-identifier hs-type">liftTcM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198503"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198503"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-558"></span><span id="liftTcM"><span class="annot"><span class="annottext">liftTcM :: forall a. TcM a -&gt; TcM a
</span><a href="GHC.Runtime.Heap.Inspect.html#liftTcM"><span class="hs-identifier hs-var hs-var">liftTcM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM a -&gt; TcM a
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-559"></span><span>
</span><span id="line-560"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#newVar"><span class="hs-identifier hs-type">newVar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span>
</span><span id="line-561"></span><span id="newVar"><span class="annot"><span class="annottext">newVar :: TcType -&gt; TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#newVar"><span class="hs-identifier hs-var hs-var">newVar</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TR TcType -&gt; TR TcType
forall a. TcM a -&gt; TcM a
</span><a href="GHC.Runtime.Heap.Inspect.html#liftTcM"><span class="hs-identifier hs-var">liftTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TR TcType -&gt; TR TcType)
-&gt; (TcType -&gt; TR TcType) -&gt; TcType -&gt; TR TcType
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span>
</span><span id="line-562"></span><span>
</span><span id="line-563"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#newOpenVar"><span class="hs-identifier hs-type">newOpenVar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span>
</span><span id="line-564"></span><span id="newOpenVar"><span class="annot"><span class="annottext">newOpenVar :: TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#newOpenVar"><span class="hs-identifier hs-var hs-var">newOpenVar</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TR TcType -&gt; TR TcType
forall a. TcM a -&gt; TcM a
</span><a href="GHC.Runtime.Heap.Inspect.html#liftTcM"><span class="hs-identifier hs-var">liftTcM</span></a></span><span> </span><span class="annot"><span class="annottext">TR TcType
</span><a href="GHC.Tc.Utils.TcMType.html#newOpenFlexiTyVarTy"><span class="hs-identifier hs-var">newOpenFlexiTyVarTy</span></a></span><span>
</span><span id="line-565"></span><span>
</span><span id="line-566"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#instTyVars"><span class="hs-identifier hs-type">instTyVars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Subst.html#TCvSubst"><span class="hs-identifier hs-type">TCvSubst</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TcTyVar"><span class="hs-identifier hs-type">TcTyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-567"></span><span class="hs-comment">-- Instantiate fresh mutable type variables from some TyVars</span><span>
</span><span id="line-568"></span><span class="hs-comment">-- This function preserves the print-name, which helps error messages</span><span>
</span><span id="line-569"></span><span id="instTyVars"><span class="annot"><span class="annottext">instTyVars :: [TyVar] -&gt; TR (TCvSubst, [TyVar])
</span><a href="GHC.Runtime.Heap.Inspect.html#instTyVars"><span class="hs-identifier hs-var hs-var">instTyVars</span></a></span></span><span> </span><span id="local-6989586621681197434"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197434"><span class="hs-identifier hs-var">tvs</span></a></span></span><span>
</span><span id="line-570"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TR (TCvSubst, [TyVar]) -&gt; TR (TCvSubst, [TyVar])
forall a. TcM a -&gt; TcM a
</span><a href="GHC.Runtime.Heap.Inspect.html#liftTcM"><span class="hs-identifier hs-var">liftTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TR (TCvSubst, [TyVar]) -&gt; TR (TCvSubst, [TyVar]))
-&gt; TR (TCvSubst, [TyVar]) -&gt; TR (TCvSubst, [TyVar])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((TCvSubst, [TyVar]), WantedConstraints) -&gt; (TCvSubst, [TyVar])
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">(((TCvSubst, [TyVar]), WantedConstraints) -&gt; (TCvSubst, [TyVar]))
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) ((TCvSubst, [TyVar]), WantedConstraints)
-&gt; TR (TCvSubst, [TyVar])
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TR (TCvSubst, [TyVar])
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) ((TCvSubst, [TyVar]), WantedConstraints)
forall a. TcM a -&gt; TcM (a, WantedConstraints)
</span><a href="GHC.Tc.Utils.Monad.html#captureConstraints"><span class="hs-identifier hs-var">captureConstraints</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyVar] -&gt; TR (TCvSubst, [TyVar])
</span><a href="GHC.Tc.Utils.TcMType.html#newMetaTyVars"><span class="hs-identifier hs-var">newMetaTyVars</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197434"><span class="hs-identifier hs-var">tvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-571"></span><span>
</span><span id="line-572"></span><span class="hs-keyword">type</span><span> </span><span id="RttiInstantiation"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiInstantiation"><span class="hs-identifier hs-var">RttiInstantiation</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#TcTyVar"><span class="hs-identifier hs-type">TcTyVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-573"></span><span>   </span><span class="hs-comment">-- Associates the typechecker-world meta type variables</span><span>
</span><span id="line-574"></span><span>   </span><span class="hs-comment">-- (which are mutable and may be refined), to their</span><span>
</span><span id="line-575"></span><span>   </span><span class="hs-comment">-- debugger-world RuntimeUnk counterparts.</span><span>
</span><span id="line-576"></span><span>   </span><span class="hs-comment">-- If the TcTyVar has not been refined by the runtime type</span><span>
</span><span id="line-577"></span><span>   </span><span class="hs-comment">-- elaboration, then we want to turn it back into the</span><span>
</span><span id="line-578"></span><span>   </span><span class="hs-comment">-- original RuntimeUnk</span><span>
</span><span id="line-579"></span><span>
</span><span id="line-580"></span><span class="hs-comment">-- | Returns the instantiated type scheme ty', and the</span><span>
</span><span id="line-581"></span><span class="hs-comment">--   mapping from new (instantiated) -to- old (skolem) type variables</span><span>
</span><span id="line-582"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#instScheme"><span class="hs-identifier hs-type">instScheme</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#QuantifiedType"><span class="hs-identifier hs-type">QuantifiedType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiInstantiation"><span class="hs-identifier hs-type">RttiInstantiation</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-583"></span><span id="instScheme"><span class="annot"><span class="annottext">instScheme :: QuantifiedType -&gt; TR (TcType, RttiInstantiation)
</span><a href="GHC.Runtime.Heap.Inspect.html#instScheme"><span class="hs-identifier hs-var hs-var">instScheme</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197430"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197430"><span class="hs-identifier hs-var">tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197429"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197429"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-584"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197428"><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681197428"><span class="hs-identifier hs-var">subst</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197427"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197427"><span class="hs-identifier hs-var">tvs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; TR (TCvSubst, [TyVar])
</span><a href="GHC.Runtime.Heap.Inspect.html#instTyVars"><span class="hs-identifier hs-var">instTyVars</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197430"><span class="hs-identifier hs-var">tvs</span></a></span><span>
</span><span id="line-585"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681197426"><span class="annot"><span class="annottext">rtti_inst :: RttiInstantiation
</span><a href="#local-6989586621681197426"><span class="hs-identifier hs-var hs-var">rtti_inst</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681197425"><span class="hs-identifier hs-var">tv'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681197424"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197425"><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681197425"><span class="hs-identifier hs-var">tv'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681197424"><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681197424"><span class="hs-identifier hs-var">tv</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197427"><span class="hs-identifier hs-var">tvs'</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; [TyVar] -&gt; RttiInstantiation
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197430"><span class="hs-identifier hs-var">tvs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-586"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(TcType, RttiInstantiation) -&gt; TR (TcType, RttiInstantiation)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasCallStack =&gt; TCvSubst -&gt; TcType -&gt; TcType
TCvSubst -&gt; TcType -&gt; TcType
</span><a href="GHC.Core.TyCo.Subst.html#substTy"><span class="hs-identifier hs-var">substTy</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681197428"><span class="hs-identifier hs-var">subst</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197429"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">RttiInstantiation
</span><a href="#local-6989586621681197426"><span class="hs-identifier hs-var">rtti_inst</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-587"></span><span>
</span><span id="line-588"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#applyRevSubst"><span class="hs-identifier hs-type">applyRevSubst</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiInstantiation"><span class="hs-identifier hs-type">RttiInstantiation</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-589"></span><span class="hs-comment">-- Apply the *reverse* substitution in-place to any un-filled-in</span><span>
</span><span id="line-590"></span><span class="hs-comment">-- meta tyvars.  This recovers the original debugger-world variable</span><span>
</span><span id="line-591"></span><span class="hs-comment">-- unless it has been refined by new information from the heap</span><span>
</span><span id="line-592"></span><span id="applyRevSubst"><span class="annot"><span class="annottext">applyRevSubst :: RttiInstantiation -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#applyRevSubst"><span class="hs-identifier hs-var hs-var">applyRevSubst</span></a></span></span><span> </span><span id="local-6989586621681197421"><span class="annot"><span class="annottext">RttiInstantiation
</span><a href="#local-6989586621681197421"><span class="hs-identifier hs-var">pairs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TR () -&gt; TR ()
forall a. TcM a -&gt; TcM a
</span><a href="GHC.Runtime.Heap.Inspect.html#liftTcM"><span class="hs-identifier hs-var">liftTcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((TyVar, TyVar) -&gt; TR ()) -&gt; RttiInstantiation -&gt; TR ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">(TyVar, TyVar) -&gt; TR ()
</span><a href="#local-6989586621681197419"><span class="hs-identifier hs-var">do_pair</span></a></span><span> </span><span class="annot"><span class="annottext">RttiInstantiation
</span><a href="#local-6989586621681197421"><span class="hs-identifier hs-var">pairs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-593"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-594"></span><span>    </span><span id="local-6989586621681197419"><span class="annot"><span class="annottext">do_pair :: (TyVar, TyVar) -&gt; TR ()
</span><a href="#local-6989586621681197419"><span class="hs-identifier hs-var hs-var">do_pair</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197416"><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681197416"><span class="hs-identifier hs-var">tc_tv</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197415"><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681197415"><span class="hs-identifier hs-var">rtti_tv</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-595"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681197414"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197414"><span class="hs-identifier hs-var">tc_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyVar -&gt; TR TcType
</span><a href="GHC.Tc.Utils.TcMType.html#zonkTcTyVar"><span class="hs-identifier hs-var">zonkTcTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681197416"><span class="hs-identifier hs-var">tc_tv</span></a></span><span>
</span><span id="line-596"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Maybe TyVar
</span><a href="GHC.Tc.Utils.TcType.html#tcGetTyVar_maybe"><span class="hs-identifier hs-var">tcGetTyVar_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197414"><span class="hs-identifier hs-var">tc_ty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-597"></span><span>               </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681197411"><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681197411"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyVar -&gt; Bool
</span><a href="GHC.Tc.Utils.TcType.html#isMetaTyVar"><span class="hs-identifier hs-var">isMetaTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681197411"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TyVar -&gt; TcType -&gt; TR ()
</span><a href="GHC.Tc.Utils.TcMType.html#writeMetaTyVar"><span class="hs-identifier hs-var">writeMetaTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681197411"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyVar -&gt; TcType
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTy"><span class="hs-identifier hs-var">mkTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681197415"><span class="hs-identifier hs-var">rtti_tv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-598"></span><span>               </span><span class="annot"><span class="annottext">Maybe TyVar
</span><span class="hs-identifier">_</span></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; TR ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-599"></span><span>
</span><span id="line-600"></span><span class="hs-comment">-- Adds a constraint of the form t1 == t2</span><span>
</span><span id="line-601"></span><span class="hs-comment">-- t1 is expected to come from walking the heap</span><span>
</span><span id="line-602"></span><span class="hs-comment">-- t2 is expected to come from a datacon signature</span><span>
</span><span id="line-603"></span><span class="hs-comment">-- Before unification, congruenceNewtypes needs to</span><span>
</span><span id="line-604"></span><span class="hs-comment">-- do its magic.</span><span>
</span><span id="line-605"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#addConstraint"><span class="hs-identifier hs-type">addConstraint</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-606"></span><span id="addConstraint"><span class="annot"><span class="annottext">addConstraint :: TcType -&gt; TcType -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#addConstraint"><span class="hs-identifier hs-var hs-var">addConstraint</span></a></span></span><span> </span><span id="local-6989586621681197406"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197406"><span class="hs-identifier hs-var">actual</span></a></span></span><span> </span><span id="local-6989586621681197405"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197405"><span class="hs-identifier hs-var">expected</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-607"></span><span>    </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;add constraint:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#fsep"><span class="hs-identifier hs-var">fsep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197406"><span class="hs-identifier hs-var">actual</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#equals"><span class="hs-identifier hs-var">equals</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197405"><span class="hs-identifier hs-var">expected</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-608"></span><span>    </span><span class="annot"><span class="annottext">TR () -&gt; TR () -&gt; TR ()
forall a. TR a -&gt; TR a -&gt; TR a
</span><a href="GHC.Runtime.Heap.Inspect.html#recoverTR"><span class="hs-identifier hs-var">recoverTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; TR ()) -&gt; SDoc -&gt; TR ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#fsep"><span class="hs-identifier hs-var">fsep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Failed to unify&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197406"><span class="hs-identifier hs-var">actual</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-609"></span><span>                                    </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;with&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197405"><span class="hs-identifier hs-var">expected</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TR () -&gt; TR ()) -&gt; TR () -&gt; TR ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-610"></span><span>      </span><span class="annot"><span class="annottext">TcM (TcCoercionN, WantedConstraints) -&gt; TR ()
forall a. TcM a -&gt; TR ()
</span><a href="GHC.Tc.Utils.Monad.html#discardResult"><span class="hs-identifier hs-var">discardResult</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (TcCoercionN, WantedConstraints) -&gt; TR ())
-&gt; TcM (TcCoercionN, WantedConstraints) -&gt; TR ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-611"></span><span>      </span><span class="annot"><span class="annottext">TcM TcCoercionN -&gt; TcM (TcCoercionN, WantedConstraints)
forall a. TcM a -&gt; TcM (a, WantedConstraints)
</span><a href="GHC.Tc.Utils.Monad.html#captureConstraints"><span class="hs-identifier hs-var">captureConstraints</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM TcCoercionN -&gt; TcM (TcCoercionN, WantedConstraints))
-&gt; TcM TcCoercionN -&gt; TcM (TcCoercionN, WantedConstraints)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-612"></span><span>      </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197402"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197402"><span class="hs-identifier hs-var">ty1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197401"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197401"><span class="hs-identifier hs-var">ty2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TR (TcType, TcType)
</span><a href="GHC.Runtime.Heap.Inspect.html#congruenceNewtypes"><span class="hs-identifier hs-var">congruenceNewtypes</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197406"><span class="hs-identifier hs-var">actual</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197405"><span class="hs-identifier hs-var">expected</span></a></span><span>
</span><span id="line-613"></span><span>         </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe (HsExpr GhcRn) -&gt; TcType -&gt; TcType -&gt; TcM TcCoercionN
</span><a href="GHC.Tc.Utils.Unify.html#unifyType"><span class="hs-identifier hs-var">unifyType</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (HsExpr GhcRn)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197402"><span class="hs-identifier hs-var">ty1</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197401"><span class="hs-identifier hs-var">ty2</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-614"></span><span>     </span><span class="hs-comment">-- TOMDO: what about the coercion?</span><span>
</span><span id="line-615"></span><span>     </span><span class="hs-comment">-- we should consider family instances</span><span>
</span><span id="line-616"></span><span>
</span><span id="line-617"></span><span>
</span><span id="line-618"></span><span class="hs-comment">-- | Term reconstruction</span><span>
</span><span id="line-619"></span><span class="hs-comment">--</span><span>
</span><span id="line-620"></span><span class="hs-comment">-- Given a pointer to a heap object (`HValue`) and its type, build a `Term`</span><span>
</span><span id="line-621"></span><span class="hs-comment">-- representation of the object. Subterms (objects in the payload) are also</span><span>
</span><span id="line-622"></span><span class="hs-comment">-- built up to the given `max_depth`. After `max_depth` any subterms will appear</span><span>
</span><span id="line-623"></span><span class="hs-comment">-- as `Suspension`s. Any thunks found while traversing the object will be forced</span><span>
</span><span id="line-624"></span><span class="hs-comment">-- based on `force` parameter.</span><span>
</span><span id="line-625"></span><span class="hs-comment">--</span><span>
</span><span id="line-626"></span><span class="hs-comment">-- Types of terms will be refined based on constructors we find during term</span><span>
</span><span id="line-627"></span><span class="hs-comment">-- reconstruction. See `cvReconstructType` for an overview of how type</span><span>
</span><span id="line-628"></span><span class="hs-comment">-- reconstruction works.</span><span>
</span><span id="line-629"></span><span class="hs-comment">--</span><span>
</span><span id="line-630"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#cvObtainTerm"><span class="hs-identifier hs-type">cvObtainTerm</span></a></span><span>
</span><span id="line-631"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span>
</span><span id="line-632"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>      </span><span class="hs-comment">-- ^ How many times to recurse for subterms</span><span>
</span><span id="line-633"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>     </span><span class="hs-comment">-- ^ Force thunks</span><span>
</span><span id="line-634"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-comment">-- ^ Type of the object to reconstruct</span><span>
</span><span id="line-635"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span>   </span><span class="hs-comment">-- ^ Object to reconstruct</span><span>
</span><span id="line-636"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span>
</span><span id="line-637"></span><span id="cvObtainTerm"><span class="annot"><span class="annottext">cvObtainTerm :: HscEnv -&gt; Int -&gt; Bool -&gt; TcType -&gt; ForeignHValue -&gt; IO Term
</span><a href="GHC.Runtime.Heap.Inspect.html#cvObtainTerm"><span class="hs-identifier hs-var hs-var">cvObtainTerm</span></a></span></span><span> </span><span id="local-6989586621681197398"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197398"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681197397"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197397"><span class="hs-identifier hs-var">max_depth</span></a></span></span><span> </span><span id="local-6989586621681197396"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681197396"><span class="hs-identifier hs-var">force</span></a></span></span><span> </span><span id="local-6989586621681197395"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197395"><span class="hs-identifier hs-var">old_ty</span></a></span></span><span> </span><span id="local-6989586621681197394"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197394"><span class="hs-identifier hs-var">hval</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; TR Term -&gt; IO Term
forall a. HscEnv -&gt; TR a -&gt; IO a
</span><a href="GHC.Runtime.Heap.Inspect.html#runTR"><span class="hs-identifier hs-var">runTR</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197398"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">(TR Term -&gt; IO Term) -&gt; TR Term -&gt; IO Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-638"></span><span>  </span><span class="hs-comment">-- we quantify existential tyvars as universal,</span><span>
</span><span id="line-639"></span><span>  </span><span class="hs-comment">-- as this is needed to be able to manipulate</span><span>
</span><span id="line-640"></span><span>  </span><span class="hs-comment">-- them properly</span><span>
</span><span id="line-641"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681197393"><span class="annot"><span class="annottext">quant_old_ty :: QuantifiedType
</span><a href="#local-6989586621681197393"><span class="hs-identifier hs-var">quant_old_ty</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621681197392"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197392"><span class="hs-identifier hs-var">old_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197391"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197391"><span class="hs-identifier hs-var">old_tau</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; QuantifiedType
</span><a href="GHC.Runtime.Heap.Inspect.html#quantifyType"><span class="hs-identifier hs-var">quantifyType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197395"><span class="hs-identifier hs-var">old_ty</span></a></span><span>
</span><span id="line-642"></span><span>       </span><span id="local-6989586621681197389"><span class="annot"><span class="annottext">sigma_old_ty :: TcType
</span><a href="#local-6989586621681197389"><span class="hs-identifier hs-var hs-var">sigma_old_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; TcType -&gt; TcType
</span><a href="GHC.Core.Type.html#mkInfForAllTys"><span class="hs-identifier hs-var">mkInfForAllTys</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197392"><span class="hs-identifier hs-var">old_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197391"><span class="hs-identifier hs-var">old_tau</span></a></span><span>
</span><span id="line-643"></span><span>   </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Term reconstruction started with initial type &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197395"><span class="hs-identifier hs-var">old_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-644"></span><span>   </span><span id="local-6989586621681197387"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197387"><span class="hs-identifier hs-var">term</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-645"></span><span>     </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197392"><span class="hs-identifier hs-var">old_tvs</span></a></span><span>
</span><span id="line-646"></span><span>      </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-647"></span><span>        </span><span id="local-6989586621681197386"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197386"><span class="hs-identifier hs-var">term</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; TcType -&gt; TcType -&gt; ForeignHValue -&gt; TR Term
</span><a href="#local-6989586621681197385"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197397"><span class="hs-identifier hs-var">max_depth</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197389"><span class="hs-identifier hs-var">sigma_old_ty</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197389"><span class="hs-identifier hs-var">sigma_old_ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197394"><span class="hs-identifier hs-var">hval</span></a></span><span>
</span><span id="line-648"></span><span>        </span><span id="local-6989586621681197384"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197384"><span class="hs-identifier hs-var">term'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Term -&gt; TR Term
</span><a href="GHC.Runtime.Heap.Inspect.html#zonkTerm"><span class="hs-identifier hs-var">zonkTerm</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197386"><span class="hs-identifier hs-var">term</span></a></span><span>
</span><span id="line-649"></span><span>        </span><span class="annot"><span class="annottext">Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Term -&gt; TR Term) -&gt; Term -&gt; TR Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; Term
</span><a href="#local-6989586621681197382"><span class="hs-identifier hs-var">fixFunDictionaries</span></a></span><span> </span><span class="annot"><span class="annottext">(Term -&gt; Term) -&gt; Term -&gt; Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; Term
</span><a href="#local-6989586621681197381"><span class="hs-identifier hs-var">expandNewtypes</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197384"><span class="hs-identifier hs-var">term'</span></a></span><span>
</span><span id="line-650"></span><span>      </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-651"></span><span>              </span><span class="hs-special">(</span><span id="local-6989586621681197380"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197380"><span class="hs-identifier hs-var">old_ty'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197379"><span class="annot"><span class="annottext">RttiInstantiation
</span><a href="#local-6989586621681197379"><span class="hs-identifier hs-var">rev_subst</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">QuantifiedType -&gt; TR (TcType, RttiInstantiation)
</span><a href="GHC.Runtime.Heap.Inspect.html#instScheme"><span class="hs-identifier hs-var">instScheme</span></a></span><span> </span><span class="annot"><span class="annottext">QuantifiedType
</span><a href="#local-6989586621681197393"><span class="hs-identifier hs-var">quant_old_ty</span></a></span><span>
</span><span id="line-652"></span><span>              </span><span id="local-6989586621681197378"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197378"><span class="hs-identifier hs-var">my_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#newOpenVar"><span class="hs-identifier hs-var">newOpenVar</span></a></span><span>
</span><span id="line-653"></span><span>              </span><span class="annot"><span class="annottext">Bool -&gt; TR () -&gt; TR ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">QuantifiedType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#check1"><span class="hs-identifier hs-var">check1</span></a></span><span> </span><span class="annot"><span class="annottext">QuantifiedType
</span><a href="#local-6989586621681197393"><span class="hs-identifier hs-var">quant_old_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;check1 passed&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TR () -&gt; TR () -&gt; TR ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span>
</span><span id="line-654"></span><span>                                          </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#addConstraint"><span class="hs-identifier hs-var">addConstraint</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197378"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197380"><span class="hs-identifier hs-var">old_ty'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-655"></span><span>              </span><span id="local-6989586621681197375"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197375"><span class="hs-identifier hs-var">term</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; TcType -&gt; TcType -&gt; ForeignHValue -&gt; TR Term
</span><a href="#local-6989586621681197385"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197397"><span class="hs-identifier hs-var">max_depth</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197378"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197389"><span class="hs-identifier hs-var">sigma_old_ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197394"><span class="hs-identifier hs-var">hval</span></a></span><span>
</span><span id="line-656"></span><span>              </span><span id="local-6989586621681197374"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197374"><span class="hs-identifier hs-var">new_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Tc.Utils.TcMType.html#zonkTcType"><span class="hs-identifier hs-var">zonkTcType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#termType"><span class="hs-identifier hs-var">termType</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197375"><span class="hs-identifier hs-var">term</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-657"></span><span>              </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isMonomorphic"><span class="hs-identifier hs-var">isMonomorphic</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197374"><span class="hs-identifier hs-var">new_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">QuantifiedType -&gt; QuantifiedType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#check2"><span class="hs-identifier hs-var">check2</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; QuantifiedType
</span><a href="GHC.Runtime.Heap.Inspect.html#quantifyType"><span class="hs-identifier hs-var">quantifyType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197374"><span class="hs-identifier hs-var">new_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">QuantifiedType
</span><a href="#local-6989586621681197393"><span class="hs-identifier hs-var">quant_old_ty</span></a></span><span>
</span><span id="line-658"></span><span>                 </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-659"></span><span>                      </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;check2 passed&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-660"></span><span>                      </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#addConstraint"><span class="hs-identifier hs-var">addConstraint</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197374"><span class="hs-identifier hs-var">new_ty</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197380"><span class="hs-identifier hs-var">old_ty'</span></a></span><span>
</span><span id="line-661"></span><span>                      </span><span class="annot"><span class="annottext">RttiInstantiation -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#applyRevSubst"><span class="hs-identifier hs-var">applyRevSubst</span></a></span><span> </span><span class="annot"><span class="annottext">RttiInstantiation
</span><a href="#local-6989586621681197379"><span class="hs-identifier hs-var">rev_subst</span></a></span><span>
</span><span id="line-662"></span><span>                      </span><span id="local-6989586621681197369"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197369"><span class="hs-identifier hs-var">zterm'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Term -&gt; TR Term
</span><a href="GHC.Runtime.Heap.Inspect.html#zonkTerm"><span class="hs-identifier hs-var">zonkTerm</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197375"><span class="hs-identifier hs-var">term</span></a></span><span>
</span><span id="line-663"></span><span>                      </span><span class="annot"><span class="annottext">Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Term -&gt; Term
</span><a href="#local-6989586621681197382"><span class="hs-identifier hs-var">fixFunDictionaries</span></a></span><span> </span><span class="annot"><span class="annottext">(Term -&gt; Term) -&gt; (Term -&gt; Term) -&gt; Term -&gt; Term
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; Term
</span><a href="#local-6989586621681197381"><span class="hs-identifier hs-var">expandNewtypes</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197369"><span class="hs-identifier hs-var">zterm'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-664"></span><span>                 </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-665"></span><span>                      </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;check2 failed&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span>
</span><span id="line-666"></span><span>                                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Term -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197375"><span class="hs-identifier hs-var">term</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;::&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197374"><span class="hs-identifier hs-var">new_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-667"></span><span>                      </span><span class="hs-comment">-- we have unsound types. Replace constructor types in</span><span>
</span><span id="line-668"></span><span>                      </span><span class="hs-comment">-- subterms with tyvars</span><span>
</span><span id="line-669"></span><span>                      </span><span id="local-6989586621681197368"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197368"><span class="hs-identifier hs-var">zterm'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(TcType -&gt; TR TcType) -&gt; Term -&gt; TR Term
forall (m :: * -&gt; *).
Monad m =&gt;
(TcType -&gt; m TcType) -&gt; Term -&gt; m Term
</span><a href="GHC.Runtime.Heap.Inspect.html#mapTermTypeM"><span class="hs-identifier hs-var">mapTermTypeM</span></a></span><span>
</span><span id="line-670"></span><span>                                 </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681197367"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197367"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; TcType -&gt; Maybe (TyCon, [TcType])
TcType -&gt; Maybe (TyCon, [TcType])
</span><a href="GHC.Core.Type.html#tcSplitTyConApp_maybe"><span class="hs-identifier hs-var">tcSplitTyConApp_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197367"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-671"></span><span>                                           </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197366"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197366"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><span class="hs-identifier">_</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[TcType]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197366"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#funTyCon"><span class="hs-identifier hs-var">funTyCon</span></a></span><span>
</span><span id="line-672"></span><span>                                               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#newOpenVar"><span class="hs-identifier hs-var">newOpenVar</span></a></span><span>
</span><span id="line-673"></span><span>                                           </span><span class="annot"><span class="annottext">Maybe (TyCon, [TcType])
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197367"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-674"></span><span>                                 </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197375"><span class="hs-identifier hs-var">term</span></a></span><span>
</span><span id="line-675"></span><span>                      </span><span class="annot"><span class="annottext">Term -&gt; TR Term
</span><a href="GHC.Runtime.Heap.Inspect.html#zonkTerm"><span class="hs-identifier hs-var">zonkTerm</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197368"><span class="hs-identifier hs-var">zterm'</span></a></span><span>
</span><span id="line-676"></span><span>   </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Term reconstruction completed.&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-677"></span><span>            </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Term obtained: &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197387"><span class="hs-identifier hs-var">term</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-678"></span><span>            </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Type obtained: &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Term -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#termType"><span class="hs-identifier hs-var">termType</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197387"><span class="hs-identifier hs-var">term</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-679"></span><span>   </span><span class="annot"><span class="annottext">Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197387"><span class="hs-identifier hs-var">term</span></a></span><span>
</span><span id="line-680"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-681"></span><span>  </span><span class="annot"><a href="#local-6989586621681197385"><span class="hs-identifier hs-type">go</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span>
</span><span id="line-682"></span><span>   </span><span class="hs-comment">-- I believe that my_ty should not have any enclosing</span><span>
</span><span id="line-683"></span><span>   </span><span class="hs-comment">-- foralls, nor any free RuntimeUnk skolems;</span><span>
</span><span id="line-684"></span><span>   </span><span class="hs-comment">-- that is partly what the quantifyType stuff achieved</span><span>
</span><span id="line-685"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-686"></span><span>   </span><span class="hs-comment">-- [SPJ May 11] I don't understand the difference between my_ty and old_ty</span><span>
</span><span id="line-687"></span><span>
</span><span id="line-688"></span><span>  </span><span id="local-6989586621681197385"><span class="annot"><span class="annottext">go :: Int -&gt; TcType -&gt; TcType -&gt; ForeignHValue -&gt; TR Term
</span><a href="#local-6989586621681197385"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span id="local-6989586621681197362"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197362"><span class="hs-identifier hs-var">my_ty</span></a></span></span><span> </span><span id="local-6989586621681197361"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197361"><span class="hs-identifier hs-var">_old_ty</span></a></span></span><span> </span><span id="local-6989586621681197360"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197360"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-689"></span><span>    </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Gave up reconstructing a term after&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-690"></span><span>                  </span><span class="annot"><span class="annottext">Int -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">int</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197397"><span class="hs-identifier hs-var">max_depth</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; steps&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-691"></span><span>    </span><span id="local-6989586621681197359"><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197359"><span class="hs-identifier hs-var">clos</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (GenClosure ForeignHValue) -&gt; TR (GenClosure ForeignHValue)
forall a. IO a -&gt; TR a
</span><a href="GHC.Runtime.Heap.Inspect.html#trIO"><span class="hs-identifier hs-var">trIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (GenClosure ForeignHValue) -&gt; TR (GenClosure ForeignHValue))
-&gt; IO (GenClosure ForeignHValue) -&gt; TR (GenClosure ForeignHValue)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ForeignHValue -&gt; IO (GenClosure ForeignHValue)
</span><a href="GHC.Runtime.Interpreter.html#getClosure"><span class="hs-identifier hs-var">GHCi.getClosure</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197398"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197360"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-692"></span><span>    </span><span class="annot"><span class="annottext">Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-var">Suspension</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StgInfoTable -&gt; ClosureType
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.InfoTable.Types.html#tipe"><span class="hs-identifier hs-var hs-var">tipe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenClosure ForeignHValue -&gt; StgInfoTable
forall b. GenClosure b -&gt; StgInfoTable
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#info"><span class="hs-identifier hs-var hs-var">info</span></a></span><span> </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197359"><span class="hs-identifier hs-var">clos</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197362"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197360"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Name
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-693"></span><span>  </span><span class="annot"><a href="#local-6989586621681197385"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681197355"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197355"><span class="hs-identifier hs-var">max_depth</span></a></span></span><span> </span><span id="local-6989586621681197354"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span></span><span> </span><span id="local-6989586621681197353"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197353"><span class="hs-identifier hs-var">old_ty</span></a></span></span><span> </span><span id="local-6989586621681197352"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197352"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-694"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681197351"><span class="annot"><span class="annottext">monomorphic :: Bool
</span><a href="#local-6989586621681197351"><span class="hs-identifier hs-var hs-var">monomorphic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; Bool
</span><a href="GHC.Core.Type.html#isTyVarTy"><span class="hs-identifier hs-var">isTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-695"></span><span>    </span><span class="hs-comment">-- This ^^^ is a convention. The ancestor tests for</span><span>
</span><span id="line-696"></span><span>    </span><span class="hs-comment">-- monomorphism and passes a type instead of a tv</span><span>
</span><span id="line-697"></span><span>    </span><span id="local-6989586621681197349"><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197349"><span class="hs-identifier hs-var">clos</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (GenClosure ForeignHValue) -&gt; TR (GenClosure ForeignHValue)
forall a. IO a -&gt; TR a
</span><a href="GHC.Runtime.Heap.Inspect.html#trIO"><span class="hs-identifier hs-var">trIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (GenClosure ForeignHValue) -&gt; TR (GenClosure ForeignHValue))
-&gt; IO (GenClosure ForeignHValue) -&gt; TR (GenClosure ForeignHValue)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ForeignHValue -&gt; IO (GenClosure ForeignHValue)
</span><a href="GHC.Runtime.Interpreter.html#getClosure"><span class="hs-identifier hs-var">GHCi.getClosure</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197398"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197352"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-698"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197349"><span class="hs-identifier hs-var">clos</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-699"></span><span class="hs-comment">-- Thunks we may want to force</span><span>
</span><span id="line-700"></span><span>      </span><span id="local-6989586621681197348"><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197348"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">GenClosure ForeignHValue -&gt; Bool
forall a. GenClosure a -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isThunk"><span class="hs-identifier hs-var">isThunk</span></a></span><span> </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197348"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681197396"><span class="hs-identifier hs-var">force</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-701"></span><span>         </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Forcing a &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenClosure () -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ForeignHValue -&gt; ()) -&gt; GenClosure ForeignHValue -&gt; GenClosure ()
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; ForeignHValue -&gt; ()
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197348"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-702"></span><span>         </span><span id="local-6989586621681197347"><span class="annot"><span class="annottext">EvalResult ()
</span><a href="#local-6989586621681197347"><span class="hs-identifier hs-var">evalRslt</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (EvalResult ()) -&gt; IOEnv (Env TcGblEnv TcLclEnv) (EvalResult ())
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (EvalResult ())
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (EvalResult ()))
-&gt; IO (EvalResult ())
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (EvalResult ())
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ForeignHValue -&gt; IO (EvalResult ())
</span><a href="GHC.Runtime.Interpreter.html#seqHValue"><span class="hs-identifier hs-var">GHCi.seqHValue</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197398"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197352"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-703"></span><span>         </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">EvalResult ()
</span><a href="#local-6989586621681197347"><span class="hs-identifier hs-var">evalRslt</span></a></span><span> </span><span class="hs-keyword">of</span><span>                                            </span><span class="hs-comment">-- #2950</span><span>
</span><span id="line-704"></span><span>           </span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#EvalSuccess"><span class="hs-identifier hs-type">EvalSuccess</span></a></span><span> </span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; TcType -&gt; TcType -&gt; ForeignHValue -&gt; TR Term
</span><a href="#local-6989586621681197385"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int
forall a. Enum a =&gt; a -&gt; a
</span><a href="../../base/src/GHC.Enum.html#pred"><span class="hs-identifier hs-var">pred</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197355"><span class="hs-identifier hs-var">max_depth</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197353"><span class="hs-identifier hs-var">old_ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197352"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-705"></span><span>           </span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#EvalException"><span class="hs-identifier hs-type">EvalException</span></a></span><span> </span><span id="local-6989586621681197342"><span class="annot"><span class="annottext">SerializableException
</span><a href="#local-6989586621681197342"><span class="hs-identifier hs-var">ex</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-706"></span><span>              </span><span class="hs-comment">-- Report the exception to the UI</span><span>
</span><span id="line-707"></span><span>              </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; TR ()) -&gt; SDoc -&gt; TR ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Exception occured:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SerializableException -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">SerializableException
</span><a href="#local-6989586621681197342"><span class="hs-identifier hs-var">ex</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-708"></span><span>              </span><span class="annot"><span class="annottext">IO Term -&gt; TR Term
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Term -&gt; TR Term) -&gt; IO Term -&gt; TR Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException -&gt; IO Term
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">(SomeException -&gt; IO Term) -&gt; SomeException -&gt; IO Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SerializableException -&gt; SomeException
</span><a href="../../ghci/src/GHCi.Message.html#fromSerializableException"><span class="hs-identifier hs-var">fromSerializableException</span></a></span><span> </span><span class="annot"><span class="annottext">SerializableException
</span><a href="#local-6989586621681197342"><span class="hs-identifier hs-var">ex</span></a></span><span>
</span><span id="line-709"></span><span class="hs-comment">-- Blackholes are indirections iff the payload is not TSO or BLOCKING_QUEUE. If</span><span>
</span><span id="line-710"></span><span class="hs-comment">-- the indirection is a TSO or BLOCKING_QUEUE, we return the BLACKHOLE itself as</span><span>
</span><span id="line-711"></span><span class="hs-comment">-- the suspension so that entering it in GHCi will enter the BLACKHOLE instead</span><span>
</span><span id="line-712"></span><span class="hs-comment">-- of entering the TSO or BLOCKING_QUEUE (which leads to runtime panic).</span><span>
</span><span id="line-713"></span><span>      </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#BlackholeClosure"><span class="hs-identifier hs-type">BlackholeClosure</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">indirectee :: forall b. GenClosure b -&gt; b
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#indirectee"><span class="hs-identifier hs-var">indirectee</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197339"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197339"><span class="hs-identifier hs-var">ind</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-714"></span><span>         </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Following a BLACKHOLE&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-715"></span><span>         </span><span id="local-6989586621681197338"><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197338"><span class="hs-identifier hs-var">ind_clos</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (GenClosure ForeignHValue) -&gt; TR (GenClosure ForeignHValue)
forall a. IO a -&gt; TR a
</span><a href="GHC.Runtime.Heap.Inspect.html#trIO"><span class="hs-identifier hs-var">trIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; ForeignHValue -&gt; IO (GenClosure ForeignHValue)
</span><a href="GHC.Runtime.Interpreter.html#getClosure"><span class="hs-identifier hs-var">GHCi.getClosure</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197398"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197339"><span class="hs-identifier hs-var">ind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-716"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681197336"><span class="annot"><span class="annottext">return_bh_value :: TR Term
</span><a href="#local-6989586621681197336"><span class="hs-identifier hs-var hs-var">return_bh_value</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-var">Suspension</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureType
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.ClosureTypes.html#BLACKHOLE"><span class="hs-identifier hs-var">BLACKHOLE</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197352"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Name
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-717"></span><span>         </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197338"><span class="hs-identifier hs-var">ind_clos</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-718"></span><span>           </span><span class="hs-comment">-- TSO and BLOCKING_QUEUE cases</span><span>
</span><span id="line-719"></span><span>           </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#BlockingQueueClosure"><span class="hs-identifier hs-type">BlockingQueueClosure</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TR Term
</span><a href="#local-6989586621681197336"><span class="hs-identifier hs-var">return_bh_value</span></a></span><span>
</span><span id="line-720"></span><span>           </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#OtherClosure"><span class="hs-identifier hs-type">OtherClosure</span></a></span><span> </span><span id="local-6989586621681197332"><span class="annot"><span class="annottext">StgInfoTable
</span><a href="#local-6989586621681197332"><span class="hs-identifier hs-var">info</span></a></span></span><span> </span><span class="annot"><span class="annottext">[ForeignHValue]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Word]
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-721"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">StgInfoTable -&gt; ClosureType
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.InfoTable.Types.html#tipe"><span class="hs-identifier hs-var hs-var">tipe</span></a></span><span> </span><span class="annot"><span class="annottext">StgInfoTable
</span><a href="#local-6989586621681197332"><span class="hs-identifier hs-var">info</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureType -&gt; ClosureType -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ClosureType
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.ClosureTypes.html#TSO"><span class="hs-identifier hs-var">TSO</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TR Term
</span><a href="#local-6989586621681197336"><span class="hs-identifier hs-var">return_bh_value</span></a></span><span>
</span><span id="line-722"></span><span>           </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#UnsupportedClosure"><span class="hs-identifier hs-type">UnsupportedClosure</span></a></span><span> </span><span id="local-6989586621681197329"><span class="annot"><span class="annottext">StgInfoTable
</span><a href="#local-6989586621681197329"><span class="hs-identifier hs-var">info</span></a></span></span><span>
</span><span id="line-723"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">StgInfoTable -&gt; ClosureType
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.InfoTable.Types.html#tipe"><span class="hs-identifier hs-var hs-var">tipe</span></a></span><span> </span><span class="annot"><span class="annottext">StgInfoTable
</span><a href="#local-6989586621681197329"><span class="hs-identifier hs-var">info</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureType -&gt; ClosureType -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ClosureType
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.ClosureTypes.html#TSO"><span class="hs-identifier hs-var">TSO</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TR Term
</span><a href="#local-6989586621681197336"><span class="hs-identifier hs-var">return_bh_value</span></a></span><span>
</span><span id="line-724"></span><span>           </span><span class="hs-comment">-- Otherwise follow the indirectee</span><span>
</span><span id="line-725"></span><span>           </span><span class="hs-comment">-- (NOTE: This code will break if we support TSO in ghc-heap one day)</span><span>
</span><span id="line-726"></span><span>           </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; TcType -&gt; TcType -&gt; ForeignHValue -&gt; TR Term
</span><a href="#local-6989586621681197385"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197355"><span class="hs-identifier hs-var">max_depth</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197353"><span class="hs-identifier hs-var">old_ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197339"><span class="hs-identifier hs-var">ind</span></a></span><span>
</span><span id="line-727"></span><span class="hs-comment">-- We always follow indirections</span><span>
</span><span id="line-728"></span><span>      </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#IndClosure"><span class="hs-identifier hs-type">IndClosure</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">indirectee :: forall b. GenClosure b -&gt; b
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#indirectee"><span class="hs-identifier hs-var">indirectee</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197327"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197327"><span class="hs-identifier hs-var">ind</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-729"></span><span>         </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Following an indirection&quot;</span></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-730"></span><span>         </span><span class="annot"><span class="annottext">Int -&gt; TcType -&gt; TcType -&gt; ForeignHValue -&gt; TR Term
</span><a href="#local-6989586621681197385"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197355"><span class="hs-identifier hs-var">max_depth</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197353"><span class="hs-identifier hs-var">old_ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197327"><span class="hs-identifier hs-var">ind</span></a></span><span>
</span><span id="line-731"></span><span class="hs-comment">-- We also follow references</span><span>
</span><span id="line-732"></span><span>      </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#MutVarClosure"><span class="hs-identifier hs-type">MutVarClosure</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">var :: forall b. GenClosure b -&gt; b
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#var"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197324"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197324"><span class="hs-identifier hs-var">contents</span></a></span></span><span class="hs-special">}</span><span>
</span><span id="line-733"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197323"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197323"><span class="hs-identifier hs-var">tycon</span></a></span></span><span class="hs-special">,</span><span class="hs-special">[</span><span id="local-6989586621681197322"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197322"><span class="hs-identifier hs-var">world</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681197321"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197321"><span class="hs-identifier hs-var">contents_ty</span></a></span></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; TcType -&gt; Maybe (TyCon, [TcType])
TcType -&gt; Maybe (TyCon, [TcType])
</span><a href="GHC.Core.Type.html#tcSplitTyConApp_maybe"><span class="hs-identifier hs-var">tcSplitTyConApp_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197353"><span class="hs-identifier hs-var">old_ty</span></a></span><span>
</span><span id="line-734"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-735"></span><span>                  </span><span class="hs-comment">-- Deal with the MutVar# primitive</span><span>
</span><span id="line-736"></span><span>                  </span><span class="hs-comment">-- It does not have a constructor at all,</span><span>
</span><span id="line-737"></span><span>                  </span><span class="hs-comment">-- so we simulate the following one</span><span>
</span><span id="line-738"></span><span>                  </span><span class="hs-comment">-- MutVar# :: contents_ty -&gt; MutVar# s contents_ty</span><span>
</span><span id="line-739"></span><span>         </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Following a MutVar&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-740"></span><span>         </span><span id="local-6989586621681197320"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197320"><span class="hs-identifier hs-var">contents_tv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#newVar"><span class="hs-identifier hs-var">newVar</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-741"></span><span>         </span><span class="hs-identifier">MASSERT</span><span class="hs-special">(</span><span class="hs-identifier">isUnliftedType</span><span> </span><span class="hs-identifier">my_ty</span><span class="hs-special">)</span><span>
</span><span id="line-742"></span><span>         </span><span class="hs-special">(</span><span id="local-6989586621681197317"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197317"><span class="hs-identifier hs-var">mutvar_ty</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">RttiInstantiation
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">QuantifiedType -&gt; TR (TcType, RttiInstantiation)
</span><a href="GHC.Runtime.Heap.Inspect.html#instScheme"><span class="hs-identifier hs-var">instScheme</span></a></span><span> </span><span class="annot"><span class="annottext">(QuantifiedType -&gt; TR (TcType, RttiInstantiation))
-&gt; QuantifiedType -&gt; TR (TcType, RttiInstantiation)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; QuantifiedType
</span><a href="GHC.Runtime.Heap.Inspect.html#quantifyType"><span class="hs-identifier hs-var">quantifyType</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType -&gt; QuantifiedType) -&gt; TcType -&gt; QuantifiedType
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TcType
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-identifier hs-var">mkVisFunTyMany</span></a></span><span>
</span><span id="line-743"></span><span>                            </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197321"><span class="hs-identifier hs-var">contents_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; [TcType] -&gt; TcType
</span><a href="GHC.Core.TyCo.Rep.html#mkTyConApp"><span class="hs-identifier hs-var">mkTyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197323"><span class="hs-identifier hs-var">tycon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197322"><span class="hs-identifier hs-var">world</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197321"><span class="hs-identifier hs-var">contents_ty</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-744"></span><span>         </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#addConstraint"><span class="hs-identifier hs-var">addConstraint</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TcType
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-identifier hs-var">mkVisFunTyMany</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197320"><span class="hs-identifier hs-var">contents_tv</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197317"><span class="hs-identifier hs-var">mutvar_ty</span></a></span><span>
</span><span id="line-745"></span><span>         </span><span id="local-6989586621681197314"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197314"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; TcType -&gt; TcType -&gt; ForeignHValue -&gt; TR Term
</span><a href="#local-6989586621681197385"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int
forall a. Enum a =&gt; a -&gt; a
</span><a href="../../base/src/GHC.Enum.html#pred"><span class="hs-identifier hs-var">pred</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197355"><span class="hs-identifier hs-var">max_depth</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197320"><span class="hs-identifier hs-var">contents_tv</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197321"><span class="hs-identifier hs-var">contents_ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197324"><span class="hs-identifier hs-var">contents</span></a></span><span>
</span><span id="line-746"></span><span>         </span><span class="annot"><span class="annottext">Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#RefWrap"><span class="hs-identifier hs-var">RefWrap</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197314"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-747"></span><span>
</span><span id="line-748"></span><span> </span><span class="hs-comment">-- The interesting case</span><span>
</span><span id="line-749"></span><span>      </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#ConstrClosure"><span class="hs-identifier hs-type">ConstrClosure</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">ptrArgs :: forall b. GenClosure b -&gt; [b]
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#ptrArgs"><span class="hs-identifier hs-var">ptrArgs</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197312"><span class="annot"><span class="annottext">[ForeignHValue]
</span><a href="#local-6989586621681197312"><span class="hs-identifier hs-var">pArgs</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">dataArgs :: forall b. GenClosure b -&gt; [Word]
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#dataArgs"><span class="hs-identifier hs-var">dataArgs</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197310"><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197310"><span class="hs-identifier hs-var">dArgs</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-750"></span><span>        </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;entering a constructor &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Word] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197310"><span class="hs-identifier hs-var">dArgs</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-751"></span><span>                      </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681197351"><span class="hs-identifier hs-var">monomorphic</span></a></span><span>
</span><span id="line-752"></span><span>                        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;already monomorphic: &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-753"></span><span>                        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Ppr.empty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-754"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681197308"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681197308"><span class="hs-identifier hs-var">dcname</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Either String Name)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Either String Name)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Either String Name)
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Either String Name))
-&gt; IO (Either String Name)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Either String Name)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; GenClosure ForeignHValue -&gt; IO (Either String Name)
forall a. HscEnv -&gt; GenClosure a -&gt; IO (Either String Name)
</span><a href="GHC.Runtime.Heap.Inspect.html#constrClosToName"><span class="hs-identifier hs-var">constrClosToName</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197398"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197349"><span class="hs-identifier hs-var">clos</span></a></span><span>
</span><span id="line-755"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681197307"><span class="annot"><span class="annottext">Maybe DataCon
</span><a href="#local-6989586621681197307"><span class="hs-identifier hs-var">mb_dc</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Messages
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn DataCon -&gt; TcRn (Maybe DataCon, Messages)
forall a. TcRn a -&gt; TcRn (Maybe a, Messages)
</span><a href="GHC.Tc.Utils.Monad.html#tryTc"><span class="hs-identifier hs-var">tryTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; TcRn DataCon
</span><a href="GHC.Tc.Utils.Env.html#tcLookupDataCon"><span class="hs-identifier hs-var">tcLookupDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681197308"><span class="hs-identifier hs-var">dcname</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-756"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe DataCon
</span><a href="#local-6989586621681197307"><span class="hs-identifier hs-var">mb_dc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-757"></span><span>          </span><span class="annot"><span class="annottext">Maybe DataCon
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-comment">-- This can happen for private constructors compiled -O0</span><span>
</span><span id="line-758"></span><span>                        </span><span class="hs-comment">-- where the .hi descriptor does not export them</span><span>
</span><span id="line-759"></span><span>                        </span><span class="hs-comment">-- In such case, we return a best approximation:</span><span>
</span><span id="line-760"></span><span>                        </span><span class="hs-comment">--  ignore the unpointed args, and recover the pointeds</span><span>
</span><span id="line-761"></span><span>                        </span><span class="hs-comment">-- This preserves laziness, and should be safe.</span><span>
</span><span id="line-762"></span><span>                       </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Not constructor&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681197308"><span class="hs-identifier hs-var">dcname</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-763"></span><span>                       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681197304"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681197304"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197398"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-764"></span><span>                           </span><span id="local-6989586621681197301"><span class="annot"><span class="annottext">tag :: String
</span><a href="#local-6989586621681197301"><span class="hs-identifier hs-var hs-var">tag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Name -&gt; String
forall a. Outputable a =&gt; DynFlags -&gt; a -&gt; String
</span><a href="GHC.Utils.Outputable.html#showPpr"><span class="hs-identifier hs-var">showPpr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681197304"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681197308"><span class="hs-identifier hs-var">dcname</span></a></span><span>
</span><span id="line-765"></span><span>                       </span><span id="local-6989586621681197299"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197299"><span class="hs-identifier hs-var">vars</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; TR TcType -&gt; IOEnv (Env TcGblEnv TcLclEnv) [TcType]
forall (m :: * -&gt; *) a. Applicative m =&gt; Int -&gt; m a -&gt; m [a]
</span><a href="../../base/src/Control.Monad.html#replicateM"><span class="hs-identifier hs-var">replicateM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ForeignHValue] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[ForeignHValue]
</span><a href="#local-6989586621681197312"><span class="hs-identifier hs-var">pArgs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-766"></span><span>                                              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#newVar"><span class="hs-identifier hs-var">newVar</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-767"></span><span>                       </span><span id="local-6989586621681197296"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197296"><span class="hs-identifier hs-var">subTerms</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TR Term] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Term]
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Traversable t, Monad m) =&gt;
t (m a) -&gt; m (t a)
</span><a href="../../base/src/Data.Traversable.html#sequence"><span class="hs-identifier hs-var">sequence</span></a></span><span> </span><span class="annot"><span class="annottext">([TR Term] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Term])
-&gt; [TR Term] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Term]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(ForeignHValue -&gt; TcType -&gt; TR Term)
-&gt; [ForeignHValue] -&gt; [TcType] -&gt; [TR Term]
forall a b c. (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="../../base/src/GHC.List.html#zipWith"><span class="hs-identifier hs-var">zipWith</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681197293"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197293"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681197292"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197292"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-768"></span><span>                           </span><span class="annot"><span class="annottext">Int -&gt; TcType -&gt; TcType -&gt; ForeignHValue -&gt; TR Term
</span><a href="#local-6989586621681197385"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int
forall a. Enum a =&gt; a -&gt; a
</span><a href="../../base/src/GHC.Enum.html#pred"><span class="hs-identifier hs-var">pred</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197355"><span class="hs-identifier hs-var">max_depth</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197292"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197292"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197293"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[ForeignHValue]
</span><a href="#local-6989586621681197312"><span class="hs-identifier hs-var">pArgs</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197299"><span class="hs-identifier hs-var">vars</span></a></span><span>
</span><span id="line-769"></span><span>                       </span><span class="annot"><span class="annottext">Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TermProcessor Term Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-var">Term</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Either String DataCon
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&lt;'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681197301"><span class="hs-identifier hs-var">tag</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&gt;&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197352"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197296"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-770"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681197291"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197291"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-771"></span><span>            </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Is constructor&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197291"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-772"></span><span>            </span><span id="local-6989586621681197290"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197290"><span class="hs-identifier hs-var">subTtypes</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; TcType -&gt; IOEnv (Env TcGblEnv TcLclEnv) [TcType]
</span><a href="GHC.Runtime.Heap.Inspect.html#getDataConArgTys"><span class="hs-identifier hs-var">getDataConArgTys</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197291"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span><span>
</span><span id="line-773"></span><span>            </span><span id="local-6989586621681197288"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197288"><span class="hs-identifier hs-var">subTerms</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(TcType -&gt; ForeignHValue -&gt; TR Term)
-&gt; GenClosure ForeignHValue
-&gt; [TcType]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#extractSubTerms"><span class="hs-identifier hs-var">extractSubTerms</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681197286"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197286"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; TcType -&gt; TcType -&gt; ForeignHValue -&gt; TR Term
</span><a href="#local-6989586621681197385"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int
forall a. Enum a =&gt; a -&gt; a
</span><a href="../../base/src/GHC.Enum.html#pred"><span class="hs-identifier hs-var">pred</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197355"><span class="hs-identifier hs-var">max_depth</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197286"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197286"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197349"><span class="hs-identifier hs-var">clos</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197290"><span class="hs-identifier hs-var">subTtypes</span></a></span><span>
</span><span id="line-774"></span><span>            </span><span class="annot"><span class="annottext">Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TermProcessor Term Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-var">Term</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; Either String DataCon
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197291"><span class="hs-identifier hs-var">dc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197352"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197288"><span class="hs-identifier hs-var">subTerms</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-775"></span><span>
</span><span id="line-776"></span><span>      </span><span class="hs-comment">-- This is to support printing of Integers. It's not a general</span><span>
</span><span id="line-777"></span><span>      </span><span class="hs-comment">-- mechanism by any means; in particular we lose the size in</span><span>
</span><span id="line-778"></span><span>      </span><span class="hs-comment">-- bytes of the array.</span><span>
</span><span id="line-779"></span><span>      </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#ArrWordsClosure"><span class="hs-identifier hs-type">ArrWordsClosure</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">bytes :: forall b. GenClosure b -&gt; Word
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#bytes"><span class="hs-identifier hs-var">bytes</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197283"><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197283"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">arrWords :: forall b. GenClosure b -&gt; [Word]
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#arrWords"><span class="hs-identifier hs-var">arrWords</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197281"><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197281"><span class="hs-identifier hs-var">ws</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-780"></span><span>         </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ByteArray# closure, size &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Word -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197283"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-781"></span><span>         </span><span class="annot"><span class="annottext">Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TermProcessor Term Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-var">Term</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Either String DataCon
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ByteArray#&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197352"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TcType -&gt; [Word] -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-var">Prim</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197281"><span class="hs-identifier hs-var">ws</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-782"></span><span>
</span><span id="line-783"></span><span class="hs-comment">-- The otherwise case: can be a Thunk,AP,PAP,etc.</span><span>
</span><span id="line-784"></span><span>      </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-785"></span><span>         </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Unknown closure:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-786"></span><span>                  </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenClosure () -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ForeignHValue -&gt; ()) -&gt; GenClosure ForeignHValue -&gt; GenClosure ()
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; ForeignHValue -&gt; ()
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197349"><span class="hs-identifier hs-var">clos</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-787"></span><span>         </span><span class="annot"><span class="annottext">Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-var">Suspension</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StgInfoTable -&gt; ClosureType
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.InfoTable.Types.html#tipe"><span class="hs-identifier hs-var hs-var">tipe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenClosure ForeignHValue -&gt; StgInfoTable
forall b. GenClosure b -&gt; StgInfoTable
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#info"><span class="hs-identifier hs-var hs-var">info</span></a></span><span> </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197349"><span class="hs-identifier hs-var">clos</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197354"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197352"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Name
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-788"></span><span>
</span><span id="line-789"></span><span>  </span><span class="hs-comment">-- insert NewtypeWraps around newtypes</span><span>
</span><span id="line-790"></span><span>  </span><span id="local-6989586621681197381"><span class="annot"><span class="annottext">expandNewtypes :: Term -&gt; Term
</span><a href="#local-6989586621681197381"><span class="hs-identifier hs-var hs-var">expandNewtypes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFold Term -&gt; Term -&gt; Term
forall a. TermFold a -&gt; Term -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#foldTerm"><span class="hs-identifier hs-var">foldTerm</span></a></span><span> </span><span class="annot"><span class="annottext">TermFold Term
</span><a href="GHC.Runtime.Heap.Inspect.html#idTermFold"><span class="hs-identifier hs-var">idTermFold</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fTerm :: TermProcessor Term Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fTerm"><span class="hs-identifier hs-var">fTerm</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermProcessor Term Term
</span><a href="#local-6989586621681197280"><span class="hs-identifier hs-var">worker</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-791"></span><span>   </span><span id="local-6989586621681197280"><span class="annot"><span class="annottext">worker :: TermProcessor Term Term
</span><a href="#local-6989586621681197280"><span class="hs-identifier hs-var hs-var">worker</span></a></span></span><span> </span><span id="local-6989586621681197277"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197277"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681197276"><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681197276"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621681197275"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197275"><span class="hs-identifier hs-var">hval</span></a></span></span><span> </span><span id="local-6989586621681197274"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197274"><span class="hs-identifier hs-var">tt</span></a></span></span><span>
</span><span id="line-792"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197273"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197273"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197272"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197272"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; TcType -&gt; Maybe (TyCon, [TcType])
TcType -&gt; Maybe (TyCon, [TcType])
</span><a href="GHC.Core.Type.html#tcSplitTyConApp_maybe"><span class="hs-identifier hs-var">tcSplitTyConApp_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197277"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-793"></span><span>     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isNewTyCon"><span class="hs-identifier hs-var">isNewTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197273"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-794"></span><span>     </span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197271"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197271"><span class="hs-identifier hs-var">wrapped_type</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [TcType] -&gt; TcType
</span><a href="GHC.Core.Type.html#newTyConInstRhs"><span class="hs-identifier hs-var">newTyConInstRhs</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197273"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197272"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-795"></span><span>     </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681197269"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197269"><span class="hs-identifier hs-var">dc'</span></a></span></span><span>        </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Maybe DataCon
</span><a href="GHC.Core.TyCon.html#tyConSingleDataCon_maybe"><span class="hs-identifier hs-var">tyConSingleDataCon_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197273"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-796"></span><span>     </span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197268"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197268"><span class="hs-identifier hs-var">t'</span></a></span></span><span>              </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TermProcessor Term Term
</span><a href="#local-6989586621681197280"><span class="hs-identifier hs-var">worker</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197271"><span class="hs-identifier hs-var">wrapped_type</span></a></span><span> </span><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681197276"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197275"><span class="hs-identifier hs-var">hval</span></a></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197274"><span class="hs-identifier hs-var">tt</span></a></span><span>
</span><span id="line-797"></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Either String DataCon -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#NewtypeWrap"><span class="hs-identifier hs-var">NewtypeWrap</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197277"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; Either String DataCon
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197269"><span class="hs-identifier hs-var">dc'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197268"><span class="hs-identifier hs-var">t'</span></a></span><span>
</span><span id="line-798"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermProcessor Term Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-var">Term</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197277"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681197276"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197275"><span class="hs-identifier hs-var">hval</span></a></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197274"><span class="hs-identifier hs-var">tt</span></a></span><span>
</span><span id="line-799"></span><span>
</span><span id="line-800"></span><span>
</span><span id="line-801"></span><span>   </span><span class="hs-comment">-- Avoid returning types where predicates have been expanded to dictionaries.</span><span>
</span><span id="line-802"></span><span>  </span><span id="local-6989586621681197382"><span class="annot"><span class="annottext">fixFunDictionaries :: Term -&gt; Term
</span><a href="#local-6989586621681197382"><span class="hs-identifier hs-var hs-var">fixFunDictionaries</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFold Term -&gt; Term -&gt; Term
forall a. TermFold a -&gt; Term -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#foldTerm"><span class="hs-identifier hs-var">foldTerm</span></a></span><span> </span><span class="annot"><span class="annottext">TermFold Term
</span><a href="GHC.Runtime.Heap.Inspect.html#idTermFold"><span class="hs-identifier hs-var">idTermFold</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">fSuspension :: ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fSuspension"><span class="hs-identifier hs-var">fSuspension</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; Term
</span><a href="#local-6989586621681197267"><span class="hs-identifier hs-var">worker</span></a></span><span class="hs-special">}</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-803"></span><span>      </span><span id="local-6989586621681197267"><span class="annot"><span class="annottext">worker :: ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; Term
</span><a href="#local-6989586621681197267"><span class="hs-identifier hs-var hs-var">worker</span></a></span></span><span> </span><span id="local-6989586621681197266"><span class="annot"><span class="annottext">ClosureType
</span><a href="#local-6989586621681197266"><span class="hs-identifier hs-var">ct</span></a></span></span><span> </span><span id="local-6989586621681197265"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197265"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681197264"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197264"><span class="hs-identifier hs-var">hval</span></a></span></span><span> </span><span id="local-6989586621681197263"><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681197263"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Bool
</span><a href="GHC.Core.Type.html#isFunTy"><span class="hs-identifier hs-var">isFunTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197265"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-var">Suspension</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureType
</span><a href="#local-6989586621681197266"><span class="hs-identifier hs-var">ct</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#dictsView"><span class="hs-identifier hs-var">dictsView</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197265"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197264"><span class="hs-identifier hs-var">hval</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681197263"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-804"></span><span>                          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-var">Suspension</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureType
</span><a href="#local-6989586621681197266"><span class="hs-identifier hs-var">ct</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197265"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197264"><span class="hs-identifier hs-var">hval</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681197263"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-805"></span><span>
</span><span id="line-806"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#extractSubTerms"><span class="hs-identifier hs-type">extractSubTerms</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-807"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#GenClosure"><span class="hs-identifier hs-type">GenClosure</span></a></span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-808"></span><span id="extractSubTerms"><span class="annot"><span class="annottext">extractSubTerms :: (TcType -&gt; ForeignHValue -&gt; TR Term)
-&gt; GenClosure ForeignHValue
-&gt; [TcType]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Term]
</span><a href="GHC.Runtime.Heap.Inspect.html#extractSubTerms"><span class="hs-identifier hs-var hs-var">extractSubTerms</span></a></span></span><span> </span><span id="local-6989586621681197260"><span class="annot"><span class="annottext">TcType -&gt; ForeignHValue -&gt; TR Term
</span><a href="#local-6989586621681197260"><span class="hs-identifier hs-var">recurse</span></a></span></span><span> </span><span id="local-6989586621681197259"><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197259"><span class="hs-identifier hs-var">clos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Int, Int, [Term]) -&gt; [Term])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Term]
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">(Int, Int, [Term]) -&gt; [Term]
forall a b c. (a, b, c) -&gt; c
</span><a href="GHC.Utils.Misc.html#thdOf3"><span class="hs-identifier hs-var">thdOf3</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Term])
-&gt; ([TcType] -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term]))
-&gt; [TcType]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Term]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Int
-&gt; Int
-&gt; [TcType]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
</span><a href="#local-6989586621681197257"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-809"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-810"></span><span>    </span><span id="local-6989586621681197256"><span class="annot"><span class="annottext">array :: [Word]
</span><a href="#local-6989586621681197256"><span class="hs-identifier hs-var hs-var">array</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenClosure ForeignHValue -&gt; [Word]
forall b. GenClosure b -&gt; [Word]
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#dataArgs"><span class="hs-identifier hs-var hs-var">dataArgs</span></a></span><span> </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197259"><span class="hs-identifier hs-var">clos</span></a></span><span>
</span><span id="line-811"></span><span>
</span><span id="line-812"></span><span>    </span><span id="local-6989586621681197257"><span class="annot"><span class="annottext">go :: Int
-&gt; Int
-&gt; [TcType]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
</span><a href="#local-6989586621681197257"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621681197242"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197242"><span class="hs-identifier hs-var">ptr_i</span></a></span></span><span> </span><span id="local-6989586621681197241"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197241"><span class="hs-identifier hs-var">arr_i</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int, Int, [Term])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197242"><span class="hs-identifier hs-var">ptr_i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197241"><span class="hs-identifier hs-var">arr_i</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-813"></span><span>    </span><span class="annot"><a href="#local-6989586621681197257"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621681197240"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197240"><span class="hs-identifier hs-var">ptr_i</span></a></span></span><span> </span><span id="local-6989586621681197239"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197239"><span class="hs-identifier hs-var">arr_i</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197238"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197238"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681197237"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197237"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-814"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197236"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197236"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197235"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197235"><span class="hs-identifier hs-var">elem_tys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; TcType -&gt; Maybe (TyCon, [TcType])
TcType -&gt; Maybe (TyCon, [TcType])
</span><a href="GHC.Core.Type.html#tcSplitTyConApp_maybe"><span class="hs-identifier hs-var">tcSplitTyConApp_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197238"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-815"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isUnboxedTupleTyCon"><span class="hs-identifier hs-var">isUnboxedTupleTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197236"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-816"></span><span>                </span><span class="hs-comment">-- See Note [Unboxed tuple RuntimeRep vars] in GHC.Core.TyCon</span><span>
</span><span id="line-817"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197233"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197233"><span class="hs-identifier hs-var">ptr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197232"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197232"><span class="hs-identifier hs-var">arr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197231"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197231"><span class="hs-identifier hs-var">terms0</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-818"></span><span>               </span><span class="annot"><span class="annottext">Int
-&gt; Int
-&gt; [TcType]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
</span><a href="#local-6989586621681197257"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197240"><span class="hs-identifier hs-var">ptr_i</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197239"><span class="hs-identifier hs-var">arr_i</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TcType] -&gt; [TcType]
</span><a href="GHC.Core.Type.html#dropRuntimeRepArgs"><span class="hs-identifier hs-var">dropRuntimeRepArgs</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197235"><span class="hs-identifier hs-var">elem_tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-819"></span><span>           </span><span class="hs-special">(</span><span id="local-6989586621681197229"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197229"><span class="hs-identifier hs-var">ptr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197228"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197228"><span class="hs-identifier hs-var">arr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197227"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197227"><span class="hs-identifier hs-var">terms1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; Int
-&gt; [TcType]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
</span><a href="#local-6989586621681197257"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197233"><span class="hs-identifier hs-var">ptr_i</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197232"><span class="hs-identifier hs-var">arr_i</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197237"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-820"></span><span>           </span><span class="annot"><span class="annottext">(Int, Int, [Term])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197229"><span class="hs-identifier hs-var">ptr_i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197228"><span class="hs-identifier hs-var">arr_i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; [Term] -&gt; Term
</span><a href="#local-6989586621681197226"><span class="hs-identifier hs-var">unboxedTupleTerm</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197238"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197231"><span class="hs-identifier hs-var">terms0</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; [Term] -&gt; [Term]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197227"><span class="hs-identifier hs-var">terms1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-821"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-822"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; TcType -&gt; [PrimRep]
TcType -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRepArgs"><span class="hs-identifier hs-var">typePrimRepArgs</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197238"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-823"></span><span>          </span><span class="hs-special">[</span><span id="local-6989586621681197224"><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621681197224"><span class="hs-identifier hs-var">rep_ty</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span>  </span><span class="hs-keyword">do</span><span>
</span><span id="line-824"></span><span>            </span><span class="hs-special">(</span><span id="local-6989586621681197223"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197223"><span class="hs-identifier hs-var">ptr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197222"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197222"><span class="hs-identifier hs-var">arr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197221"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197221"><span class="hs-identifier hs-var">term0</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; Int
-&gt; TcType
-&gt; PrimRep
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, Term)
</span><a href="#local-6989586621681197220"><span class="hs-identifier hs-var">go_rep</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197240"><span class="hs-identifier hs-var">ptr_i</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197239"><span class="hs-identifier hs-var">arr_i</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197238"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621681197224"><span class="hs-identifier hs-var">rep_ty</span></a></span><span>
</span><span id="line-825"></span><span>            </span><span class="hs-special">(</span><span id="local-6989586621681197219"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197219"><span class="hs-identifier hs-var">ptr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197218"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197218"><span class="hs-identifier hs-var">arr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197217"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197217"><span class="hs-identifier hs-var">terms1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; Int
-&gt; [TcType]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
</span><a href="#local-6989586621681197257"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197223"><span class="hs-identifier hs-var">ptr_i</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197222"><span class="hs-identifier hs-var">arr_i</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197237"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-826"></span><span>            </span><span class="annot"><span class="annottext">(Int, Int, [Term])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197219"><span class="hs-identifier hs-var">ptr_i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197218"><span class="hs-identifier hs-var">arr_i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197221"><span class="hs-identifier hs-var">term0</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; [Term] -&gt; [Term]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197217"><span class="hs-identifier hs-var">terms1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-827"></span><span>          </span><span id="local-6989586621681197216"><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621681197216"><span class="hs-identifier hs-var">rep_tys</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-828"></span><span>           </span><span class="hs-special">(</span><span id="local-6989586621681197215"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197215"><span class="hs-identifier hs-var">ptr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197214"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197214"><span class="hs-identifier hs-var">arr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197213"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197213"><span class="hs-identifier hs-var">terms0</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; Int
-&gt; [PrimRep]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
</span><a href="#local-6989586621681197212"><span class="hs-identifier hs-var">go_unary_types</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197240"><span class="hs-identifier hs-var">ptr_i</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197239"><span class="hs-identifier hs-var">arr_i</span></a></span><span> </span><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621681197216"><span class="hs-identifier hs-var">rep_tys</span></a></span><span>
</span><span id="line-829"></span><span>           </span><span class="hs-special">(</span><span id="local-6989586621681197211"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197211"><span class="hs-identifier hs-var">ptr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197210"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197210"><span class="hs-identifier hs-var">arr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197209"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197209"><span class="hs-identifier hs-var">terms1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; Int
-&gt; [TcType]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
</span><a href="#local-6989586621681197257"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197215"><span class="hs-identifier hs-var">ptr_i</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197214"><span class="hs-identifier hs-var">arr_i</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197237"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-830"></span><span>           </span><span class="annot"><span class="annottext">(Int, Int, [Term])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197211"><span class="hs-identifier hs-var">ptr_i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197210"><span class="hs-identifier hs-var">arr_i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; [Term] -&gt; Term
</span><a href="#local-6989586621681197226"><span class="hs-identifier hs-var">unboxedTupleTerm</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197238"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197213"><span class="hs-identifier hs-var">terms0</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; [Term] -&gt; [Term]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197209"><span class="hs-identifier hs-var">terms1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-831"></span><span>
</span><span id="line-832"></span><span>    </span><span id="local-6989586621681197212"><span class="annot"><span class="annottext">go_unary_types :: Int
-&gt; Int
-&gt; [PrimRep]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
</span><a href="#local-6989586621681197212"><span class="hs-identifier hs-var hs-var">go_unary_types</span></a></span></span><span> </span><span id="local-6989586621681197203"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197203"><span class="hs-identifier hs-var">ptr_i</span></a></span></span><span> </span><span id="local-6989586621681197202"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197202"><span class="hs-identifier hs-var">arr_i</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int, Int, [Term])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197203"><span class="hs-identifier hs-var">ptr_i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197202"><span class="hs-identifier hs-var">arr_i</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-833"></span><span>    </span><span class="annot"><a href="#local-6989586621681197212"><span class="hs-identifier hs-var">go_unary_types</span></a></span><span> </span><span id="local-6989586621681197201"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197201"><span class="hs-identifier hs-var">ptr_i</span></a></span></span><span> </span><span id="local-6989586621681197200"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197200"><span class="hs-identifier hs-var">arr_i</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197199"><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621681197199"><span class="hs-identifier hs-var">rep_ty</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681197198"><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621681197198"><span class="hs-identifier hs-var">rep_tys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-834"></span><span>      </span><span id="local-6989586621681197197"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197197"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#newVar"><span class="hs-identifier hs-var">newVar</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-835"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681197196"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197196"><span class="hs-identifier hs-var">ptr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197195"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197195"><span class="hs-identifier hs-var">arr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197194"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197194"><span class="hs-identifier hs-var">term0</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; Int
-&gt; TcType
-&gt; PrimRep
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, Term)
</span><a href="#local-6989586621681197220"><span class="hs-identifier hs-var">go_rep</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197201"><span class="hs-identifier hs-var">ptr_i</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197200"><span class="hs-identifier hs-var">arr_i</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197197"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621681197199"><span class="hs-identifier hs-var">rep_ty</span></a></span><span>
</span><span id="line-836"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681197193"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197193"><span class="hs-identifier hs-var">ptr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197192"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197192"><span class="hs-identifier hs-var">arr_i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197191"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197191"><span class="hs-identifier hs-var">terms1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; Int
-&gt; [PrimRep]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
</span><a href="#local-6989586621681197212"><span class="hs-identifier hs-var">go_unary_types</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197196"><span class="hs-identifier hs-var">ptr_i</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197195"><span class="hs-identifier hs-var">arr_i</span></a></span><span> </span><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621681197198"><span class="hs-identifier hs-var">rep_tys</span></a></span><span>
</span><span id="line-837"></span><span>      </span><span class="annot"><span class="annottext">(Int, Int, [Term])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, [Term])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197193"><span class="hs-identifier hs-var">ptr_i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197192"><span class="hs-identifier hs-var">arr_i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197194"><span class="hs-identifier hs-var">term0</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; [Term] -&gt; [Term]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197191"><span class="hs-identifier hs-var">terms1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-838"></span><span>
</span><span id="line-839"></span><span>    </span><span id="local-6989586621681197220"><span class="annot"><span class="annottext">go_rep :: Int
-&gt; Int
-&gt; TcType
-&gt; PrimRep
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, Term)
</span><a href="#local-6989586621681197220"><span class="hs-identifier hs-var hs-var">go_rep</span></a></span></span><span> </span><span id="local-6989586621681197184"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197184"><span class="hs-identifier hs-var">ptr_i</span></a></span></span><span> </span><span id="local-6989586621681197183"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197183"><span class="hs-identifier hs-var">arr_i</span></a></span></span><span> </span><span id="local-6989586621681197182"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197182"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681197181"><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621681197181"><span class="hs-identifier hs-var">rep</span></a></span></span><span>
</span><span id="line-840"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">PrimRep -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isGcPtrRep"><span class="hs-identifier hs-var">isGcPtrRep</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621681197181"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-841"></span><span>          </span><span id="local-6989586621681197179"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197179"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; ForeignHValue -&gt; TR Term
</span><a href="#local-6989586621681197260"><span class="hs-identifier hs-var">recurse</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197182"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">(ForeignHValue -&gt; TR Term) -&gt; ForeignHValue -&gt; TR Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenClosure ForeignHValue -&gt; [ForeignHValue]
forall b. GenClosure b -&gt; [b]
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#ptrArgs"><span class="hs-identifier hs-var hs-var">ptrArgs</span></a></span><span> </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197259"><span class="hs-identifier hs-var">clos</span></a></span><span class="hs-special">)</span><span class="annot"><span class="annottext">[ForeignHValue] -&gt; Int -&gt; ForeignHValue
forall a. [a] -&gt; Int -&gt; a
</span><a href="../../base/src/GHC.List.html#%21%21"><span class="hs-operator hs-var">!!</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197184"><span class="hs-identifier hs-var">ptr_i</span></a></span><span>
</span><span id="line-842"></span><span>          </span><span class="annot"><span class="annottext">(Int, Int, Term) -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, Term)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197184"><span class="hs-identifier hs-var">ptr_i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197183"><span class="hs-identifier hs-var">arr_i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681197179"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-843"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-844"></span><span>          </span><span class="hs-comment">-- This is a bit involved since we allow packing multiple fields</span><span>
</span><span id="line-845"></span><span>          </span><span class="hs-comment">-- within a single word. See also</span><span>
</span><span id="line-846"></span><span>          </span><span class="hs-comment">-- GHC.StgToCmm.Layout.mkVirtHeapOffsetsWithPadding</span><span>
</span><span id="line-847"></span><span>          </span><span id="local-6989586621681197177"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681197177"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM Platform
</span><a href="GHC.Tc.Types.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-848"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681197175"><span class="annot"><span class="annottext">word_size :: Int
</span><a href="#local-6989586621681197175"><span class="hs-identifier hs-var hs-var">word_size</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Int
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681197177"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-849"></span><span>              </span><span id="local-6989586621681197173"><span class="annot"><span class="annottext">endian :: ByteOrder
</span><a href="#local-6989586621681197173"><span class="hs-identifier hs-var hs-var">endian</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOrder
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformByteOrder"><span class="hs-identifier hs-var hs-var">platformByteOrder</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681197177"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-850"></span><span>              </span><span id="local-6989586621681197171"><span class="annot"><span class="annottext">size_b :: Int
</span><a href="#local-6989586621681197171"><span class="hs-identifier hs-var hs-var">size_b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; PrimRep -&gt; Int
</span><a href="GHC.Core.TyCon.html#primRepSizeB"><span class="hs-identifier hs-var">primRepSizeB</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681197177"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621681197181"><span class="hs-identifier hs-var">rep</span></a></span><span>
</span><span id="line-851"></span><span>              </span><span class="hs-comment">-- Align the start offset (eg, 2-byte value should be 2-byte</span><span>
</span><span id="line-852"></span><span>              </span><span class="hs-comment">-- aligned). But not more than to a word. The offset calculation</span><span>
</span><span id="line-853"></span><span>              </span><span class="hs-comment">-- should be the same with the offset calculation in</span><span>
</span><span id="line-854"></span><span>              </span><span class="hs-comment">-- GHC.StgToCmm.Layout.mkVirtHeapOffsetsWithPadding.</span><span>
</span><span id="line-855"></span><span>              </span><span class="hs-glyph">!</span><span id="local-6989586621681197168"><span class="annot"><span class="annottext">aligned_idx :: Int
</span><a href="#local-6989586621681197168"><span class="hs-identifier hs-var hs-var">aligned_idx</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
</span><a href="GHC.Runtime.Heap.Layout.html#roundUpTo"><span class="hs-identifier hs-var">roundUpTo</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197183"><span class="hs-identifier hs-var">arr_i</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Ord a =&gt; a -&gt; a -&gt; a
</span><span class="hs-identifier hs-var">min</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197175"><span class="hs-identifier hs-var">word_size</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197171"><span class="hs-identifier hs-var">size_b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-856"></span><span>              </span><span class="hs-glyph">!</span><span id="local-6989586621681197165"><span class="annot"><span class="annottext">new_arr_i :: Int
</span><a href="#local-6989586621681197165"><span class="hs-identifier hs-var hs-var">new_arr_i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197168"><span class="hs-identifier hs-var">aligned_idx</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197171"><span class="hs-identifier hs-var">size_b</span></a></span><span>
</span><span id="line-857"></span><span>              </span><span id="local-6989586621681197157"><span class="annot"><span class="annottext">ws :: [Word]
</span><a href="#local-6989586621681197157"><span class="hs-identifier hs-var hs-var">ws</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197171"><span class="hs-identifier hs-var">size_b</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197175"><span class="hs-identifier hs-var">word_size</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-858"></span><span>                     </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int -&gt; ByteOrder -&gt; Word
</span><a href="#local-6989586621681197155"><span class="hs-identifier hs-var">index</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197171"><span class="hs-identifier hs-var">size_b</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197168"><span class="hs-identifier hs-var">aligned_idx</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197175"><span class="hs-identifier hs-var">word_size</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOrder
</span><a href="#local-6989586621681197173"><span class="hs-identifier hs-var">endian</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-859"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-860"></span><span>                     </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197153"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197153"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197152"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197152"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197171"><span class="hs-identifier hs-var">size_b</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; (Int, Int)
forall a. Integral a =&gt; a -&gt; a -&gt; (a, a)
</span><a href="../../base/src/GHC.Real.html#quotRem"><span class="hs-operator hs-var">`quotRem`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197175"><span class="hs-identifier hs-var">word_size</span></a></span><span>
</span><span id="line-861"></span><span>                     </span><span class="hs-keyword">in</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">r</span><span> </span><span class="hs-operator">==</span><span> </span><span class="hs-number">0</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-862"></span><span>                        </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197256"><span class="hs-identifier hs-var">array</span></a></span><span class="annot"><span class="annottext">[Word] -&gt; Int -&gt; Word
forall a. [a] -&gt; Int -&gt; a
</span><a href="../../base/src/GHC.List.html#%21%21"><span class="hs-operator hs-var">!!</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197150"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-863"></span><span>                        </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681197149"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197149"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-glyph">..</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197153"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">]</span><span>
</span><span id="line-864"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681197150"><span class="annot"><span class="annottext">i :: Int
</span><a href="#local-6989586621681197150"><span class="hs-identifier hs-var hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197168"><span class="hs-identifier hs-var">aligned_idx</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#quot"><span class="hs-operator hs-var">`quot`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197175"><span class="hs-identifier hs-var">word_size</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197149"><span class="hs-identifier hs-var">o</span></a></span><span>
</span><span id="line-865"></span><span>                        </span><span class="hs-special">]</span><span>
</span><span id="line-866"></span><span>          </span><span class="annot"><span class="annottext">(Int, Int, Term) -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Int, Int, Term)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197184"><span class="hs-identifier hs-var">ptr_i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197165"><span class="hs-identifier hs-var">new_arr_i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; [Word] -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-var">Prim</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197182"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197157"><span class="hs-identifier hs-var">ws</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-867"></span><span>
</span><span id="line-868"></span><span>    </span><span id="local-6989586621681197226"><span class="annot"><span class="annottext">unboxedTupleTerm :: TcType -&gt; [Term] -&gt; Term
</span><a href="#local-6989586621681197226"><span class="hs-identifier hs-var hs-var">unboxedTupleTerm</span></a></span></span><span> </span><span id="local-6989586621681197142"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197142"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681197141"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197141"><span class="hs-identifier hs-var">terms</span></a></span></span><span>
</span><span id="line-869"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermProcessor Term Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-var">Term</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197142"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; Either String DataCon
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Boxity -&gt; Int -&gt; DataCon
</span><a href="GHC.Builtin.Types.html#tupleDataCon"><span class="hs-identifier hs-var">tupleDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Unboxed"><span class="hs-identifier hs-var">Unboxed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Term] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197141"><span class="hs-identifier hs-var">terms</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-870"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; ForeignHValue
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;unboxedTupleTerm: no HValue for unboxed tuple&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681197141"><span class="hs-identifier hs-var">terms</span></a></span><span>
</span><span id="line-871"></span><span>
</span><span id="line-872"></span><span>    </span><span class="hs-comment">-- Extract a sub-word sized field from a word</span><span>
</span><span id="line-873"></span><span>    </span><span class="hs-comment">-- A sub word is aligned to the left-most part of a word on big-endian</span><span>
</span><span id="line-874"></span><span>    </span><span class="hs-comment">-- platforms, and to the right-most part of a word on little-endian</span><span>
</span><span id="line-875"></span><span>    </span><span class="hs-comment">-- platforms.  This allows to write and read it back from memory</span><span>
</span><span id="line-876"></span><span>    </span><span class="hs-comment">-- independent of endianness.  Bits not belonging to a sub word are zeroed</span><span>
</span><span id="line-877"></span><span>    </span><span class="hs-comment">-- out, although, this is strictly speaking not necessary since a sub word</span><span>
</span><span id="line-878"></span><span>    </span><span class="hs-comment">-- is read back from memory by appropriately casted pointers (see e.g.</span><span>
</span><span id="line-879"></span><span>    </span><span class="hs-comment">-- ppr_float of cPprTermBase).</span><span>
</span><span id="line-880"></span><span>    </span><span id="local-6989586621681197155"><span class="annot"><span class="annottext">index :: Int -&gt; Int -&gt; Int -&gt; ByteOrder -&gt; Word
</span><a href="#local-6989586621681197155"><span class="hs-identifier hs-var hs-var">index</span></a></span></span><span> </span><span id="local-6989586621681197131"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197131"><span class="hs-identifier hs-var">size_b</span></a></span></span><span> </span><span id="local-6989586621681197130"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197130"><span class="hs-identifier hs-var">aligned_idx</span></a></span></span><span> </span><span id="local-6989586621681197129"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197129"><span class="hs-identifier hs-var">word_size</span></a></span></span><span> </span><span id="local-6989586621681197128"><span class="annot"><span class="annottext">ByteOrder
</span><a href="#local-6989586621681197128"><span class="hs-identifier hs-var">endian</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteOrder
</span><a href="#local-6989586621681197128"><span class="hs-identifier hs-var">endian</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-881"></span><span>      </span><span class="annot"><span class="annottext">ByteOrder
</span><a href="../../base/src/GHC.ByteOrder.html#BigEndian"><span class="hs-identifier hs-var">BigEndian</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197126"><span class="hs-identifier hs-var">word</span></a></span><span> </span><span class="annot"><span class="annottext">Word -&gt; Int -&gt; Word
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftL"><span class="hs-operator hs-var">`shiftL`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197125"><span class="hs-identifier hs-var">moveBits</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Word -&gt; Int -&gt; Word
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftR"><span class="hs-operator hs-var">`shiftR`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197123"><span class="hs-identifier hs-var">zeroOutBits</span></a></span><span> </span><span class="annot"><span class="annottext">Word -&gt; Int -&gt; Word
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftL"><span class="hs-operator hs-var">`shiftL`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197123"><span class="hs-identifier hs-var">zeroOutBits</span></a></span><span>
</span><span id="line-882"></span><span>      </span><span class="annot"><span class="annottext">ByteOrder
</span><a href="../../base/src/GHC.ByteOrder.html#LittleEndian"><span class="hs-identifier hs-var">LittleEndian</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621681197126"><span class="hs-identifier hs-var">word</span></a></span><span> </span><span class="annot"><span class="annottext">Word -&gt; Int -&gt; Word
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftR"><span class="hs-operator hs-var">`shiftR`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197125"><span class="hs-identifier hs-var">moveBits</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Word -&gt; Int -&gt; Word
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftL"><span class="hs-operator hs-var">`shiftL`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197123"><span class="hs-identifier hs-var">zeroOutBits</span></a></span><span> </span><span class="annot"><span class="annottext">Word -&gt; Int -&gt; Word
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftR"><span class="hs-operator hs-var">`shiftR`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197123"><span class="hs-identifier hs-var">zeroOutBits</span></a></span><span>
</span><span id="line-883"></span><span>     </span><span class="hs-keyword">where</span><span>
</span><span id="line-884"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681197120"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197120"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197119"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197119"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197130"><span class="hs-identifier hs-var">aligned_idx</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; (Int, Int)
forall a. Integral a =&gt; a -&gt; a -&gt; (a, a)
</span><a href="../../base/src/GHC.Real.html#quotRem"><span class="hs-operator hs-var">`quotRem`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197129"><span class="hs-identifier hs-var">word_size</span></a></span><span>
</span><span id="line-885"></span><span>      </span><span id="local-6989586621681197126"><span class="annot"><span class="annottext">word :: Word
</span><a href="#local-6989586621681197126"><span class="hs-identifier hs-var hs-var">word</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681197256"><span class="hs-identifier hs-var">array</span></a></span><span class="annot"><span class="annottext">[Word] -&gt; Int -&gt; Word
forall a. [a] -&gt; Int -&gt; a
</span><a href="../../base/src/GHC.List.html#%21%21"><span class="hs-operator hs-var">!!</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197120"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-886"></span><span>      </span><span id="local-6989586621681197125"><span class="annot"><span class="annottext">moveBits :: Int
</span><a href="#local-6989586621681197125"><span class="hs-identifier hs-var hs-var">moveBits</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197119"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span>
</span><span id="line-887"></span><span>      </span><span id="local-6989586621681197123"><span class="annot"><span class="annottext">zeroOutBits :: Int
</span><a href="#local-6989586621681197123"><span class="hs-identifier hs-var hs-var">zeroOutBits</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197129"><span class="hs-identifier hs-var">word_size</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197131"><span class="hs-identifier hs-var">size_b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span>
</span><span id="line-888"></span><span>
</span><span id="line-889"></span><span>
</span><span id="line-890"></span><span class="hs-comment">-- | Fast, breadth-first Type reconstruction</span><span>
</span><span id="line-891"></span><span class="hs-comment">--</span><span>
</span><span id="line-892"></span><span class="hs-comment">-- Given a heap object (`HValue`) and its (possibly polymorphic) type (usually</span><span>
</span><span id="line-893"></span><span class="hs-comment">-- obtained in GHCi), try to reconstruct a more monomorphic type of the object.</span><span>
</span><span id="line-894"></span><span class="hs-comment">-- This is used for improving type information in debugger. For example, if we</span><span>
</span><span id="line-895"></span><span class="hs-comment">-- have a polymorphic function:</span><span>
</span><span id="line-896"></span><span class="hs-comment">--</span><span>
</span><span id="line-897"></span><span class="hs-comment">--     sumNumList :: Num a =&gt; [a] -&gt; a</span><span>
</span><span id="line-898"></span><span class="hs-comment">--     sumNumList [] = 0</span><span>
</span><span id="line-899"></span><span class="hs-comment">--     sumNumList (x : xs) = x + sumList xs</span><span>
</span><span id="line-900"></span><span class="hs-comment">--</span><span>
</span><span id="line-901"></span><span class="hs-comment">-- and add a breakpoint to it:</span><span>
</span><span id="line-902"></span><span class="hs-comment">--</span><span>
</span><span id="line-903"></span><span class="hs-comment">--     ghci&gt; break sumNumList</span><span>
</span><span id="line-904"></span><span class="hs-comment">--     ghci&gt; sumNumList ([0 .. 9] :: [Int])</span><span>
</span><span id="line-905"></span><span class="hs-comment">--</span><span>
</span><span id="line-906"></span><span class="hs-comment">-- ghci shows us more precise types than just `a`s:</span><span>
</span><span id="line-907"></span><span class="hs-comment">--</span><span>
</span><span id="line-908"></span><span class="hs-comment">--     Stopped in Main.sumNumList, debugger.hs:3:23-39</span><span>
</span><span id="line-909"></span><span class="hs-comment">--     _result :: Int = _</span><span>
</span><span id="line-910"></span><span class="hs-comment">--     x :: Int = 0</span><span>
</span><span id="line-911"></span><span class="hs-comment">--     xs :: [Int] = _</span><span>
</span><span id="line-912"></span><span class="hs-comment">--</span><span>
</span><span id="line-913"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#cvReconstructType"><span class="hs-identifier hs-type">cvReconstructType</span></a></span><span>
</span><span id="line-914"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span>
</span><span id="line-915"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>       </span><span class="hs-comment">-- ^ How many times to recurse for subterms</span><span>
</span><span id="line-916"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#GhciType"><span class="hs-identifier hs-type">GhciType</span></a></span><span>  </span><span class="hs-comment">-- ^ Type to refine</span><span>
</span><span id="line-917"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span>  </span><span class="hs-comment">-- ^ Refine the type using this value</span><span>
</span><span id="line-918"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-919"></span><span id="cvReconstructType"><span class="annot"><span class="annottext">cvReconstructType :: HscEnv -&gt; Int -&gt; TcType -&gt; ForeignHValue -&gt; IO (Maybe TcType)
</span><a href="GHC.Runtime.Heap.Inspect.html#cvReconstructType"><span class="hs-identifier hs-var hs-var">cvReconstructType</span></a></span></span><span> </span><span id="local-6989586621681197113"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197113"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681197112"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197112"><span class="hs-identifier hs-var">max_depth</span></a></span></span><span> </span><span id="local-6989586621681197111"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197111"><span class="hs-identifier hs-var">old_ty</span></a></span></span><span> </span><span id="local-6989586621681197110"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197110"><span class="hs-identifier hs-var">hval</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; TR TcType -&gt; IO (Maybe TcType)
forall a. HscEnv -&gt; TR a -&gt; IO (Maybe a)
</span><a href="GHC.Runtime.Heap.Inspect.html#runTR_maybe"><span class="hs-identifier hs-var">runTR_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197113"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">(TR TcType -&gt; IO (Maybe TcType)) -&gt; TR TcType -&gt; IO (Maybe TcType)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-920"></span><span>   </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;RTTI started with initial type &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197111"><span class="hs-identifier hs-var">old_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-921"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681197109"><span class="annot"><span class="annottext">sigma_old_ty :: QuantifiedType
</span><a href="#local-6989586621681197109"><span class="hs-identifier hs-var">sigma_old_ty</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621681197108"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197108"><span class="hs-identifier hs-var">old_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; QuantifiedType
</span><a href="GHC.Runtime.Heap.Inspect.html#quantifyType"><span class="hs-identifier hs-var">quantifyType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197111"><span class="hs-identifier hs-var">old_ty</span></a></span><span>
</span><span id="line-922"></span><span>   </span><span id="local-6989586621681197107"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197107"><span class="hs-identifier hs-var">new_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-923"></span><span>       </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197108"><span class="hs-identifier hs-var">old_tvs</span></a></span><span>
</span><span id="line-924"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197111"><span class="hs-identifier hs-var">old_ty</span></a></span><span>
</span><span id="line-925"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-926"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621681197106"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197106"><span class="hs-identifier hs-var">old_ty'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197105"><span class="annot"><span class="annottext">RttiInstantiation
</span><a href="#local-6989586621681197105"><span class="hs-identifier hs-var">rev_subst</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">QuantifiedType -&gt; TR (TcType, RttiInstantiation)
</span><a href="GHC.Runtime.Heap.Inspect.html#instScheme"><span class="hs-identifier hs-var">instScheme</span></a></span><span> </span><span class="annot"><span class="annottext">QuantifiedType
</span><a href="#local-6989586621681197109"><span class="hs-identifier hs-var">sigma_old_ty</span></a></span><span>
</span><span id="line-927"></span><span>          </span><span id="local-6989586621681197104"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197104"><span class="hs-identifier hs-var">my_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#newOpenVar"><span class="hs-identifier hs-var">newOpenVar</span></a></span><span>
</span><span id="line-928"></span><span>          </span><span class="annot"><span class="annottext">Bool -&gt; TR () -&gt; TR ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">QuantifiedType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#check1"><span class="hs-identifier hs-var">check1</span></a></span><span> </span><span class="annot"><span class="annottext">QuantifiedType
</span><a href="#local-6989586621681197109"><span class="hs-identifier hs-var">sigma_old_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;check1 passed&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TR () -&gt; TR () -&gt; TR ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span>
</span><span id="line-929"></span><span>                                      </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#addConstraint"><span class="hs-identifier hs-var">addConstraint</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197104"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197106"><span class="hs-identifier hs-var">old_ty'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-930"></span><span>          </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) Bool
-&gt; ((TcType, ForeignHValue)
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) [(TcType, ForeignHValue)])
-&gt; Seq (TcType, ForeignHValue)
-&gt; Int
-&gt; TR ()
forall {a} {t}.
(Eq a, Num a, Enum a) =&gt;
IOEnv (Env TcGblEnv TcLclEnv) Bool
-&gt; (t -&gt; IOEnv (Env TcGblEnv TcLclEnv) [t]) -&gt; Seq t -&gt; a -&gt; TR ()
</span><a href="#local-6989586621681197103"><span class="hs-identifier hs-var">search</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isMonomorphic"><span class="hs-identifier hs-var">isMonomorphic</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType -&gt; Bool) -&gt; TR TcType -&gt; IOEnv (Env TcGblEnv TcLclEnv) Bool
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-operator hs-var">`fmap`</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Tc.Utils.TcMType.html#zonkTcType"><span class="hs-identifier hs-var">zonkTcType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197104"><span class="hs-identifier hs-var">my_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-931"></span><span>                 </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681197102"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197102"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681197101"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197101"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType
-&gt; ForeignHValue
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(TcType, ForeignHValue)]
</span><a href="#local-6989586621681197100"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197102"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197101"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-932"></span><span>                 </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TcType, ForeignHValue) -&gt; Seq (TcType, ForeignHValue)
forall a. a -&gt; Seq a
</span><a href="../../containers/src/Data.Sequence.Internal.html#singleton"><span class="hs-identifier hs-var">Seq.singleton</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197104"><span class="hs-identifier hs-var">my_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197110"><span class="hs-identifier hs-var">hval</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-933"></span><span>                 </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197112"><span class="hs-identifier hs-var">max_depth</span></a></span><span>
</span><span id="line-934"></span><span>          </span><span id="local-6989586621681197098"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197098"><span class="hs-identifier hs-var">new_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Tc.Utils.TcMType.html#zonkTcType"><span class="hs-identifier hs-var">zonkTcType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197104"><span class="hs-identifier hs-var">my_ty</span></a></span><span>
</span><span id="line-935"></span><span>          </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isMonomorphic"><span class="hs-identifier hs-var">isMonomorphic</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197098"><span class="hs-identifier hs-var">new_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">QuantifiedType -&gt; QuantifiedType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#check2"><span class="hs-identifier hs-var">check2</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; QuantifiedType
</span><a href="GHC.Runtime.Heap.Inspect.html#quantifyType"><span class="hs-identifier hs-var">quantifyType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197098"><span class="hs-identifier hs-var">new_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">QuantifiedType
</span><a href="#local-6989586621681197109"><span class="hs-identifier hs-var">sigma_old_ty</span></a></span><span>
</span><span id="line-936"></span><span>            </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-937"></span><span>                 </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;check2 passed&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197111"><span class="hs-identifier hs-var">old_ty</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197098"><span class="hs-identifier hs-var">new_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-938"></span><span>                 </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#addConstraint"><span class="hs-identifier hs-var">addConstraint</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197104"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197106"><span class="hs-identifier hs-var">old_ty'</span></a></span><span>
</span><span id="line-939"></span><span>                 </span><span class="annot"><span class="annottext">RttiInstantiation -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#applyRevSubst"><span class="hs-identifier hs-var">applyRevSubst</span></a></span><span> </span><span class="annot"><span class="annottext">RttiInstantiation
</span><a href="#local-6989586621681197105"><span class="hs-identifier hs-var">rev_subst</span></a></span><span>
</span><span id="line-940"></span><span>                 </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#zonkRttiType"><span class="hs-identifier hs-var">zonkRttiType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197098"><span class="hs-identifier hs-var">new_ty</span></a></span><span>
</span><span id="line-941"></span><span>            </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;check2 failed&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197098"><span class="hs-identifier hs-var">new_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TR () -&gt; TR TcType -&gt; TR TcType
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span>
</span><span id="line-942"></span><span>                 </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197111"><span class="hs-identifier hs-var">old_ty</span></a></span><span>
</span><span id="line-943"></span><span>   </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;RTTI completed. Type obtained:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197107"><span class="hs-identifier hs-var">new_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-944"></span><span>   </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197107"><span class="hs-identifier hs-var">new_ty</span></a></span><span>
</span><span id="line-945"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-946"></span><span class="hs-comment">--  search :: m Bool -&gt; ([a] -&gt; [a] -&gt; [a]) -&gt; [a] -&gt; m ()</span><span>
</span><span id="line-947"></span><span>  </span><span id="local-6989586621681197103"><span class="annot"><span class="annottext">search :: IOEnv (Env TcGblEnv TcLclEnv) Bool
-&gt; (t -&gt; IOEnv (Env TcGblEnv TcLclEnv) [t]) -&gt; Seq t -&gt; a -&gt; TR ()
</span><a href="#local-6989586621681197103"><span class="hs-identifier hs-var hs-var">search</span></a></span></span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">t -&gt; IOEnv (Env TcGblEnv TcLclEnv) [t]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Seq t
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Failed to reconstruct a type after &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-948"></span><span>                                </span><span class="annot"><span class="annottext">Int -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">int</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197112"><span class="hs-identifier hs-var">max_depth</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; steps&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-949"></span><span>  </span><span class="annot"><a href="#local-6989586621681197103"><span class="hs-identifier hs-var">search</span></a></span><span> </span><span id="local-6989586621681197085"><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) Bool
</span><a href="#local-6989586621681197085"><span class="hs-identifier hs-var">stop</span></a></span></span><span> </span><span id="local-6989586621681197084"><span class="annot"><span class="annottext">t -&gt; IOEnv (Env TcGblEnv TcLclEnv) [t]
</span><a href="#local-6989586621681197084"><span class="hs-identifier hs-var">expand</span></a></span></span><span> </span><span id="local-6989586621681197083"><span class="annot"><span class="annottext">Seq t
</span><a href="#local-6989586621681197083"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681197082"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681197082"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-950"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Seq t -&gt; ViewL t
forall a. Seq a -&gt; ViewL a
</span><a href="../../containers/src/Data.Sequence.Internal.html#viewl"><span class="hs-identifier hs-var">viewl</span></a></span><span> </span><span class="annot"><span class="annottext">Seq t
</span><a href="#local-6989586621681197083"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-951"></span><span>      </span><span class="annot"><span class="annottext">ViewL t
</span><a href="../../containers/src/Data.Sequence.Internal.html#EmptyL"><span class="hs-identifier hs-var">EmptyL</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; TR ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-952"></span><span>      </span><span id="local-6989586621681197080"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681197080"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><a href="../../containers/src/Data.Sequence.Internal.html#%3A%3C"><span class="hs-operator hs-type">:&lt;</span></a></span><span> </span><span id="local-6989586621681197078"><span class="annot"><span class="annottext">Seq t
</span><a href="#local-6989586621681197078"><span class="hs-identifier hs-var">xx</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) Bool -&gt; TR () -&gt; TR ()
forall (m :: * -&gt; *). Monad m =&gt; m Bool -&gt; m () -&gt; m ()
</span><a href="GHC.Utils.Monad.html#unlessM"><span class="hs-identifier hs-var">unlessM</span></a></span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) Bool
</span><a href="#local-6989586621681197085"><span class="hs-identifier hs-var">stop</span></a></span><span> </span><span class="annot"><span class="annottext">(TR () -&gt; TR ()) -&gt; TR () -&gt; TR ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-953"></span><span>                  </span><span id="local-6989586621681197076"><span class="annot"><span class="annottext">[t]
</span><a href="#local-6989586621681197076"><span class="hs-identifier hs-var">new</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">t -&gt; IOEnv (Env TcGblEnv TcLclEnv) [t]
</span><a href="#local-6989586621681197084"><span class="hs-identifier hs-var">expand</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681197080"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-954"></span><span>                  </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) Bool
-&gt; (t -&gt; IOEnv (Env TcGblEnv TcLclEnv) [t]) -&gt; Seq t -&gt; a -&gt; TR ()
</span><a href="#local-6989586621681197103"><span class="hs-identifier hs-var">search</span></a></span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) Bool
</span><a href="#local-6989586621681197085"><span class="hs-identifier hs-var">stop</span></a></span><span> </span><span class="annot"><span class="annottext">t -&gt; IOEnv (Env TcGblEnv TcLclEnv) [t]
</span><a href="#local-6989586621681197084"><span class="hs-identifier hs-var">expand</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Seq t
</span><a href="#local-6989586621681197078"><span class="hs-identifier hs-var">xx</span></a></span><span> </span><span class="annot"><span class="annottext">Seq t -&gt; Seq t -&gt; Seq t
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-operator hs-var">`mappend`</span></a></span><span> </span><span class="annot"><span class="annottext">[t] -&gt; Seq t
forall a. [a] -&gt; Seq a
</span><a href="../../containers/src/Data.Sequence.Internal.html#fromList"><span class="hs-identifier hs-var">Seq.fromList</span></a></span><span> </span><span class="annot"><span class="annottext">[t]
</span><a href="#local-6989586621681197076"><span class="hs-identifier hs-var">new</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(a -&gt; TR ()) -&gt; a -&gt; TR ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; a
forall a. Enum a =&gt; a -&gt; a
</span><a href="../../base/src/GHC.Enum.html#pred"><span class="hs-identifier hs-var">pred</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681197082"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-955"></span><span>
</span><span id="line-956"></span><span>   </span><span class="hs-comment">-- returns unification tasks,since we are going to want a breadth-first search</span><span>
</span><span id="line-957"></span><span>  </span><span class="annot"><a href="#local-6989586621681197100"><span class="hs-identifier hs-type">go</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-958"></span><span>  </span><span id="local-6989586621681197100"><span class="annot"><span class="annottext">go :: TcType
-&gt; ForeignHValue
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(TcType, ForeignHValue)]
</span><a href="#local-6989586621681197100"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621681197073"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197073"><span class="hs-identifier hs-var">my_ty</span></a></span></span><span> </span><span id="local-6989586621681197072"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197072"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-959"></span><span>    </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;go&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197073"><span class="hs-identifier hs-var">my_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-960"></span><span>    </span><span id="local-6989586621681197071"><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197071"><span class="hs-identifier hs-var">clos</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (GenClosure ForeignHValue) -&gt; TR (GenClosure ForeignHValue)
forall a. IO a -&gt; TR a
</span><a href="GHC.Runtime.Heap.Inspect.html#trIO"><span class="hs-identifier hs-var">trIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (GenClosure ForeignHValue) -&gt; TR (GenClosure ForeignHValue))
-&gt; IO (GenClosure ForeignHValue) -&gt; TR (GenClosure ForeignHValue)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ForeignHValue -&gt; IO (GenClosure ForeignHValue)
</span><a href="GHC.Runtime.Interpreter.html#getClosure"><span class="hs-identifier hs-var">GHCi.getClosure</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197113"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197072"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-961"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197071"><span class="hs-identifier hs-var">clos</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-962"></span><span>      </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#BlackholeClosure"><span class="hs-identifier hs-type">BlackholeClosure</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">indirectee :: forall b. GenClosure b -&gt; b
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#indirectee"><span class="hs-identifier hs-var">indirectee</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197070"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197070"><span class="hs-identifier hs-var">ind</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType
-&gt; ForeignHValue
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(TcType, ForeignHValue)]
</span><a href="#local-6989586621681197100"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197073"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197070"><span class="hs-identifier hs-var">ind</span></a></span><span>
</span><span id="line-963"></span><span>      </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#IndClosure"><span class="hs-identifier hs-type">IndClosure</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">indirectee :: forall b. GenClosure b -&gt; b
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#indirectee"><span class="hs-identifier hs-var">indirectee</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197069"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197069"><span class="hs-identifier hs-var">ind</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType
-&gt; ForeignHValue
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(TcType, ForeignHValue)]
</span><a href="#local-6989586621681197100"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197073"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197069"><span class="hs-identifier hs-var">ind</span></a></span><span>
</span><span id="line-964"></span><span>      </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#MutVarClosure"><span class="hs-identifier hs-type">MutVarClosure</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">var :: forall b. GenClosure b -&gt; b
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#var"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197068"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197068"><span class="hs-identifier hs-var">contents</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-965"></span><span>         </span><span id="local-6989586621681197067"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197067"><span class="hs-identifier hs-var">tv'</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#newVar"><span class="hs-identifier hs-var">newVar</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-966"></span><span>         </span><span id="local-6989586621681197066"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197066"><span class="hs-identifier hs-var">world</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#newVar"><span class="hs-identifier hs-var">newVar</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-967"></span><span>         </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#addConstraint"><span class="hs-identifier hs-var">addConstraint</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197073"><span class="hs-identifier hs-var">my_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; [TcType] -&gt; TcType
</span><a href="GHC.Core.TyCo.Rep.html#mkTyConApp"><span class="hs-identifier hs-var">mkTyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#mutVarPrimTyCon"><span class="hs-identifier hs-var">mutVarPrimTyCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197066"><span class="hs-identifier hs-var">world</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197067"><span class="hs-identifier hs-var">tv'</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-968"></span><span>         </span><span class="annot"><span class="annottext">[(TcType, ForeignHValue)]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(TcType, ForeignHValue)]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197067"><span class="hs-identifier hs-var">tv'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197068"><span class="hs-identifier hs-var">contents</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-969"></span><span>      </span><span class="annot"><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#ConstrClosure"><span class="hs-identifier hs-type">ConstrClosure</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">ptrArgs :: forall b. GenClosure b -&gt; [b]
</span><a href="../../ghc-heap/src/GHC.Exts.Heap.Closures.html#ptrArgs"><span class="hs-identifier hs-var">ptrArgs</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681197065"><span class="annot"><span class="annottext">[ForeignHValue]
</span><a href="#local-6989586621681197065"><span class="hs-identifier hs-var">pArgs</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-970"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681197064"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681197064"><span class="hs-identifier hs-var">dcname</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Either String Name)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Either String Name)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Either String Name)
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Either String Name))
-&gt; IO (Either String Name)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Either String Name)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; GenClosure ForeignHValue -&gt; IO (Either String Name)
forall a. HscEnv -&gt; GenClosure a -&gt; IO (Either String Name)
</span><a href="GHC.Runtime.Heap.Inspect.html#constrClosToName"><span class="hs-identifier hs-var">constrClosToName</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681197113"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><a href="#local-6989586621681197071"><span class="hs-identifier hs-var">clos</span></a></span><span>
</span><span id="line-971"></span><span>        </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Constr1&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681197064"><span class="hs-identifier hs-var">dcname</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-972"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681197063"><span class="annot"><span class="annottext">Maybe DataCon
</span><a href="#local-6989586621681197063"><span class="hs-identifier hs-var">mb_dc</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Messages
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn DataCon -&gt; TcRn (Maybe DataCon, Messages)
forall a. TcRn a -&gt; TcRn (Maybe a, Messages)
</span><a href="GHC.Tc.Utils.Monad.html#tryTc"><span class="hs-identifier hs-var">tryTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; TcRn DataCon
</span><a href="GHC.Tc.Utils.Env.html#tcLookupDataCon"><span class="hs-identifier hs-var">tcLookupDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681197064"><span class="hs-identifier hs-var">dcname</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-973"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe DataCon
</span><a href="#local-6989586621681197063"><span class="hs-identifier hs-var">mb_dc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-974"></span><span>          </span><span class="annot"><span class="annottext">Maybe DataCon
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-975"></span><span>            </span><span class="annot"><span class="annottext">[ForeignHValue]
-&gt; (ForeignHValue
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (TcType, ForeignHValue))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(TcType, ForeignHValue)]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#forM"><span class="hs-identifier hs-var">forM</span></a></span><span> </span><span class="annot"><span class="annottext">[ForeignHValue]
</span><a href="#local-6989586621681197065"><span class="hs-identifier hs-var">pArgs</span></a></span><span> </span><span class="annot"><span class="annottext">((ForeignHValue
  -&gt; IOEnv (Env TcGblEnv TcLclEnv) (TcType, ForeignHValue))
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) [(TcType, ForeignHValue)])
-&gt; (ForeignHValue
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (TcType, ForeignHValue))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(TcType, ForeignHValue)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197061"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197061"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-976"></span><span>              </span><span id="local-6989586621681197060"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197060"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#newVar"><span class="hs-identifier hs-var">newVar</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-977"></span><span>              </span><span class="annot"><span class="annottext">(TcType, ForeignHValue)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (TcType, ForeignHValue)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197060"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197061"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-978"></span><span>
</span><span id="line-979"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681197059"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197059"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-980"></span><span>            </span><span id="local-6989586621681197058"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197058"><span class="hs-identifier hs-var">arg_tys</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; TcType -&gt; IOEnv (Env TcGblEnv TcLclEnv) [TcType]
</span><a href="GHC.Runtime.Heap.Inspect.html#getDataConArgTys"><span class="hs-identifier hs-var">getDataConArgTys</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197059"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197073"><span class="hs-identifier hs-var">my_ty</span></a></span><span>
</span><span id="line-981"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197057"><span class="annot"><span class="annottext">[(Int, TcType)]
</span><a href="#local-6989586621681197057"><span class="hs-identifier hs-var">itys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [TcType] -&gt; TR (Int, [(Int, TcType)])
</span><a href="GHC.Runtime.Heap.Inspect.html#findPtrTyss"><span class="hs-identifier hs-var">findPtrTyss</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197058"><span class="hs-identifier hs-var">arg_tys</span></a></span><span>
</span><span id="line-982"></span><span>            </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Constr2&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681197064"><span class="hs-identifier hs-var">dcname</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197058"><span class="hs-identifier hs-var">arg_tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-983"></span><span>            </span><span class="annot"><span class="annottext">[(TcType, ForeignHValue)]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(TcType, ForeignHValue)]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([(TcType, ForeignHValue)]
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) [(TcType, ForeignHValue)])
-&gt; [(TcType, ForeignHValue)]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(TcType, ForeignHValue)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((Int, TcType) -&gt; ForeignHValue -&gt; (TcType, ForeignHValue))
-&gt; [(Int, TcType)] -&gt; [ForeignHValue] -&gt; [(TcType, ForeignHValue)]
forall a b c. (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="../../base/src/GHC.List.html#zipWith"><span class="hs-identifier hs-var">zipWith</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681197055"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197055"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681197054"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197054"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197055"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681197054"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Int, TcType)]
</span><a href="#local-6989586621681197057"><span class="hs-identifier hs-var">itys</span></a></span><span> </span><span class="annot"><span class="annottext">[ForeignHValue]
</span><a href="#local-6989586621681197065"><span class="hs-identifier hs-var">pArgs</span></a></span><span>
</span><span id="line-984"></span><span>      </span><span class="annot"><span class="annottext">GenClosure ForeignHValue
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[(TcType, ForeignHValue)]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(TcType, ForeignHValue)]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-985"></span><span>
</span><span id="line-986"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#findPtrTys"><span class="hs-identifier hs-type">findPtrTys</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>  </span><span class="hs-comment">-- Current pointer index</span><span>
</span><span id="line-987"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-comment">-- Type</span><span>
</span><span id="line-988"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-989"></span><span id="findPtrTys"><span class="annot"><span class="annottext">findPtrTys :: Int -&gt; TcType -&gt; TR (Int, [(Int, TcType)])
</span><a href="GHC.Runtime.Heap.Inspect.html#findPtrTys"><span class="hs-identifier hs-var hs-var">findPtrTys</span></a></span></span><span> </span><span id="local-6989586621681197052"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197052"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621681197051"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197051"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-990"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197050"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197050"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197049"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197049"><span class="hs-identifier hs-var">elem_tys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; TcType -&gt; Maybe (TyCon, [TcType])
TcType -&gt; Maybe (TyCon, [TcType])
</span><a href="GHC.Core.Type.html#tcSplitTyConApp_maybe"><span class="hs-identifier hs-var">tcSplitTyConApp_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197051"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-991"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isUnboxedTupleTyCon"><span class="hs-identifier hs-var">isUnboxedTupleTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681197050"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-992"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [TcType] -&gt; TR (Int, [(Int, TcType)])
</span><a href="GHC.Runtime.Heap.Inspect.html#findPtrTyss"><span class="hs-identifier hs-var">findPtrTyss</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197052"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197049"><span class="hs-identifier hs-var">elem_tys</span></a></span><span>
</span><span id="line-993"></span><span>
</span><span id="line-994"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-995"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; TcType -&gt; [PrimRep]
TcType -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197051"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-996"></span><span>      </span><span class="hs-special">[</span><span id="local-6989586621681197047"><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621681197047"><span class="hs-identifier hs-var">rep</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">PrimRep -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isGcPtrRep"><span class="hs-identifier hs-var">isGcPtrRep</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621681197047"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Int, [(Int, TcType)]) -&gt; TR (Int, [(Int, TcType)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197052"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197052"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197051"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-997"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Int, [(Int, TcType)]) -&gt; TR (Int, [(Int, TcType)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197052"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span>     </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-998"></span><span>      </span><span id="local-6989586621681197046"><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621681197046"><span class="hs-identifier hs-var">prim_reps</span></a></span></span><span>              </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-999"></span><span>        </span><span class="annot"><span class="annottext">((Int, [(Int, TcType)]) -&gt; PrimRep -&gt; TR (Int, [(Int, TcType)]))
-&gt; (Int, [(Int, TcType)]) -&gt; [PrimRep] -&gt; TR (Int, [(Int, TcType)])
forall (t :: * -&gt; *) (m :: * -&gt; *) b a.
(Foldable t, Monad m) =&gt;
(b -&gt; a -&gt; m b) -&gt; b -&gt; t a -&gt; m b
</span><a href="../../base/src/Control.Monad.html#foldM"><span class="hs-identifier hs-var">foldM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681197044"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197044"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197043"><span class="annot"><span class="annottext">[(Int, TcType)]
</span><a href="#local-6989586621681197043"><span class="hs-identifier hs-var">extras</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681197042"><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621681197042"><span class="hs-identifier hs-var">prim_rep</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1000"></span><span>                </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">PrimRep -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isGcPtrRep"><span class="hs-identifier hs-var">isGcPtrRep</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621681197042"><span class="hs-identifier hs-var">prim_rep</span></a></span><span>
</span><span id="line-1001"></span><span>                  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#newVar"><span class="hs-identifier hs-var">newVar</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span> </span><span class="annot"><span class="annottext">TR TcType
-&gt; (TcType -&gt; TR (Int, [(Int, TcType)]))
-&gt; TR (Int, [(Int, TcType)])
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681197041"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197041"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Int, [(Int, TcType)]) -&gt; TR (Int, [(Int, TcType)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197044"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(Int, TcType)]
</span><a href="#local-6989586621681197043"><span class="hs-identifier hs-var">extras</span></a></span><span> </span><span class="annot"><span class="annottext">[(Int, TcType)] -&gt; [(Int, TcType)] -&gt; [(Int, TcType)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197044"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197041"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1002"></span><span>                  </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">(Int, [(Int, TcType)]) -&gt; TR (Int, [(Int, TcType)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197044"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(Int, TcType)]
</span><a href="#local-6989586621681197043"><span class="hs-identifier hs-var">extras</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1003"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197052"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621681197046"><span class="hs-identifier hs-var">prim_reps</span></a></span><span>
</span><span id="line-1004"></span><span>
</span><span id="line-1005"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#findPtrTyss"><span class="hs-identifier hs-type">findPtrTyss</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-1006"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1007"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1008"></span><span id="findPtrTyss"><span class="annot"><span class="annottext">findPtrTyss :: Int -&gt; [TcType] -&gt; TR (Int, [(Int, TcType)])
</span><a href="GHC.Runtime.Heap.Inspect.html#findPtrTyss"><span class="hs-identifier hs-var hs-var">findPtrTyss</span></a></span></span><span> </span><span id="local-6989586621681197040"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197040"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621681197039"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197039"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Int, [(Int, TcType)]) -&gt; TcType -&gt; TR (Int, [(Int, TcType)]))
-&gt; (Int, [(Int, TcType)]) -&gt; [TcType] -&gt; TR (Int, [(Int, TcType)])
forall (t :: * -&gt; *) (m :: * -&gt; *) b a.
(Foldable t, Monad m) =&gt;
(b -&gt; a -&gt; m b) -&gt; b -&gt; t a -&gt; m b
</span><a href="../../base/src/Control.Monad.html#foldM"><span class="hs-identifier hs-var">foldM</span></a></span><span> </span><span class="annot"><span class="annottext">(Int, [(Int, TcType)]) -&gt; TcType -&gt; TR (Int, [(Int, TcType)])
</span><a href="#local-6989586621681197038"><span class="hs-identifier hs-var">step</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197040"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197039"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-1009"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681197038"><span class="annot"><span class="annottext">step :: (Int, [(Int, TcType)]) -&gt; TcType -&gt; TR (Int, [(Int, TcType)])
</span><a href="#local-6989586621681197038"><span class="hs-identifier hs-var hs-var">step</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197035"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197035"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197034"><span class="annot"><span class="annottext">[(Int, TcType)]
</span><a href="#local-6989586621681197034"><span class="hs-identifier hs-var">discovered</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681197033"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197033"><span class="hs-identifier hs-var">elem_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1010"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621681197032"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197032"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197031"><span class="annot"><span class="annottext">[(Int, TcType)]
</span><a href="#local-6989586621681197031"><span class="hs-identifier hs-var">extras</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; TcType -&gt; TR (Int, [(Int, TcType)])
</span><a href="GHC.Runtime.Heap.Inspect.html#findPtrTys"><span class="hs-identifier hs-var">findPtrTys</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197035"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197033"><span class="hs-identifier hs-var">elem_ty</span></a></span><span>
</span><span id="line-1011"></span><span>          </span><span class="annot"><span class="annottext">(Int, [(Int, TcType)]) -&gt; TR (Int, [(Int, TcType)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681197032"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(Int, TcType)]
</span><a href="#local-6989586621681197034"><span class="hs-identifier hs-var">discovered</span></a></span><span> </span><span class="annot"><span class="annottext">[(Int, TcType)] -&gt; [(Int, TcType)] -&gt; [(Int, TcType)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[(Int, TcType)]
</span><a href="#local-6989586621681197031"><span class="hs-identifier hs-var">extras</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1012"></span><span>
</span><span id="line-1013"></span><span>
</span><span id="line-1014"></span><span class="hs-comment">-- Compute the difference between a base type and the type found by RTTI</span><span>
</span><span id="line-1015"></span><span class="hs-comment">-- improveType &lt;base_type&gt; &lt;rtti_type&gt;</span><span>
</span><span id="line-1016"></span><span class="hs-comment">-- The types can contain skolem type variables, which need to be treated as normal vars.</span><span>
</span><span id="line-1017"></span><span class="hs-comment">-- In particular, we want them to unify with things.</span><span>
</span><span id="line-1018"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#improveRTTIType"><span class="hs-identifier hs-type">improveRTTIType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Subst.html#TCvSubst"><span class="hs-identifier hs-type">TCvSubst</span></a></span><span>
</span><span id="line-1019"></span><span id="improveRTTIType"><span class="annot"><span class="annottext">improveRTTIType :: HscEnv -&gt; TcType -&gt; TcType -&gt; Maybe TCvSubst
</span><a href="GHC.Runtime.Heap.Inspect.html#improveRTTIType"><span class="hs-identifier hs-var hs-var">improveRTTIType</span></a></span></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681197030"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197030"><span class="hs-identifier hs-var">base_ty</span></a></span></span><span> </span><span id="local-6989586621681197029"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197029"><span class="hs-identifier hs-var">new_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; Maybe TCvSubst
</span><a href="GHC.Core.Unify.html#tcUnifyTyKi"><span class="hs-identifier hs-var">U.tcUnifyTyKi</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197030"><span class="hs-identifier hs-var">base_ty</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197029"><span class="hs-identifier hs-var">new_ty</span></a></span><span>
</span><span id="line-1020"></span><span>
</span><span id="line-1021"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#getDataConArgTys"><span class="hs-identifier hs-type">getDataConArgTys</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1022"></span><span class="hs-comment">-- Given the result type ty of a constructor application (D a b c :: ty)</span><span>
</span><span id="line-1023"></span><span class="hs-comment">-- return the types of the arguments.  This is RTTI-land, so 'ty' might</span><span>
</span><span id="line-1024"></span><span class="hs-comment">-- not be fully known.  Moreover, the arg types might involve existentials;</span><span>
</span><span id="line-1025"></span><span class="hs-comment">-- if so, make up fresh RTTI type variables for them</span><span>
</span><span id="line-1026"></span><span class="hs-comment">--</span><span>
</span><span id="line-1027"></span><span class="hs-comment">-- I believe that con_app_ty should not have any enclosing foralls</span><span>
</span><span id="line-1028"></span><span id="getDataConArgTys"><span class="annot"><span class="annottext">getDataConArgTys :: DataCon -&gt; TcType -&gt; IOEnv (Env TcGblEnv TcLclEnv) [TcType]
</span><a href="GHC.Runtime.Heap.Inspect.html#getDataConArgTys"><span class="hs-identifier hs-var hs-var">getDataConArgTys</span></a></span></span><span> </span><span id="local-6989586621681197027"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197027"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621681197026"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197026"><span class="hs-identifier hs-var">con_app_ty</span></a></span></span><span>
</span><span id="line-1029"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681197025"><span class="annot"><span class="annottext">rep_con_app_ty :: TcType
</span><a href="#local-6989586621681197025"><span class="hs-identifier hs-var hs-var">rep_con_app_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcType
</span><a href="GHC.Types.RepType.html#unwrapType"><span class="hs-identifier hs-var">unwrapType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197026"><span class="hs-identifier hs-var">con_app_ty</span></a></span><span>
</span><span id="line-1030"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;getDataConArgTys 1&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197026"><span class="hs-identifier hs-var">con_app_ty</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197025"><span class="hs-identifier hs-var">rep_con_app_ty</span></a></span><span>
</span><span id="line-1031"></span><span>                   </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (TyCon, [TcType]) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasCallStack =&gt; TcType -&gt; Maybe (TyCon, [TcType])
TcType -&gt; Maybe (TyCon, [TcType])
</span><a href="GHC.Core.Type.html#tcSplitTyConApp_maybe"><span class="hs-identifier hs-var">tcSplitTyConApp_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197025"><span class="hs-identifier hs-var">rep_con_app_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1032"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">all</span><span> </span><span class="hs-identifier">isTyVar</span><span> </span><span class="hs-identifier">ex_tvs</span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-identifier">return</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1033"></span><span>                 </span><span class="hs-comment">-- ex_tvs can only be tyvars as data types in source</span><span>
</span><span id="line-1034"></span><span>                 </span><span class="hs-comment">-- Haskell cannot mention covar yet (Aug 2018)</span><span>
</span><span id="line-1035"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197021"><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681197021"><span class="hs-identifier hs-var">subst</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; TR (TCvSubst, [TyVar])
</span><a href="GHC.Runtime.Heap.Inspect.html#instTyVars"><span class="hs-identifier hs-var">instTyVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197020"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; [TyVar] -&gt; [TyVar]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197022"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1036"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#addConstraint"><span class="hs-identifier hs-var">addConstraint</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197025"><span class="hs-identifier hs-var">rep_con_app_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasCallStack =&gt; TCvSubst -&gt; TcType -&gt; TcType
TCvSubst -&gt; TcType -&gt; TcType
</span><a href="GHC.Core.TyCo.Subst.html#substTy"><span class="hs-identifier hs-var">substTy</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681197021"><span class="hs-identifier hs-var">subst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; TcType
</span><a href="GHC.Core.DataCon.html#dataConOrigResTy"><span class="hs-identifier hs-var">dataConOrigResTy</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197027"><span class="hs-identifier hs-var">dc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1037"></span><span>              </span><span class="hs-comment">-- See Note [Constructor arg types]</span><span>
</span><span id="line-1038"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681197016"><span class="annot"><span class="annottext">con_arg_tys :: [TcType]
</span><a href="#local-6989586621681197016"><span class="hs-identifier hs-var hs-var">con_arg_tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; TCvSubst -&gt; [TcType] -&gt; [TcType]
TCvSubst -&gt; [TcType] -&gt; [TcType]
</span><a href="GHC.Core.TyCo.Subst.html#substTys"><span class="hs-identifier hs-var">substTys</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681197021"><span class="hs-identifier hs-var">subst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Scaled TcType -&gt; TcType) -&gt; [Scaled TcType] -&gt; [TcType]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Scaled TcType -&gt; TcType
forall a. Scaled a -&gt; a
</span><a href="GHC.Core.TyCo.Rep.html#scaledThing"><span class="hs-identifier hs-var">scaledThing</span></a></span><span> </span><span class="annot"><span class="annottext">([Scaled TcType] -&gt; [TcType]) -&gt; [Scaled TcType] -&gt; [TcType]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [Scaled TcType]
</span><a href="GHC.Core.DataCon.html#dataConRepArgTys"><span class="hs-identifier hs-var">dataConRepArgTys</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197027"><span class="hs-identifier hs-var">dc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1039"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;getDataConArgTys 2&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197025"><span class="hs-identifier hs-var">rep_con_app_ty</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197016"><span class="hs-identifier hs-var">con_arg_tys</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681197021"><span class="hs-identifier hs-var">subst</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1040"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[TcType] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [TcType]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197016"><span class="hs-identifier hs-var">con_arg_tys</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1041"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1042"></span><span>    </span><span id="local-6989586621681197020"><span class="annot"><span class="annottext">univ_tvs :: [TyVar]
</span><a href="#local-6989586621681197020"><span class="hs-identifier hs-var hs-var">univ_tvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [TyVar]
</span><a href="GHC.Core.DataCon.html#dataConUnivTyVars"><span class="hs-identifier hs-var">dataConUnivTyVars</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197027"><span class="hs-identifier hs-var">dc</span></a></span><span>
</span><span id="line-1043"></span><span>    </span><span id="local-6989586621681197022"><span class="annot"><span class="annottext">ex_tvs :: [TyVar]
</span><a href="#local-6989586621681197022"><span class="hs-identifier hs-var hs-var">ex_tvs</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [TyVar]
</span><a href="GHC.Core.DataCon.html#dataConExTyCoVars"><span class="hs-identifier hs-var">dataConExTyCoVars</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681197027"><span class="hs-identifier hs-var">dc</span></a></span><span>
</span><span id="line-1044"></span><span>
</span><span id="line-1045"></span><span class="hs-comment">{- Note [Constructor arg types]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider a GADT (cf #7386)
   data family D a b
   data instance D [a] a where
     MkT :: a -&gt; D [a] (Maybe a)
     ...

In getDataConArgTys
* con_app_ty is the known type (from outside) of the constructor application,
  say D [Int] Int

* The data constructor MkT has a (representation) dataConTyCon = DList,
  say where
    data DList a where
      MkT :: a -&gt; DList a (Maybe a)
      ...

So the dataConTyCon of the data constructor, DList, differs from
the &quot;outside&quot; type, D. So we can't straightforwardly decompose the
&quot;outside&quot; type, and we end up in the &quot;_&quot; branch of the case.

Then we match the dataConOrigResTy of the data constructor against the
outside type, hoping to get a substitution that tells how to instantiate
the *representation* type constructor.   This looks a bit delicate to
me, but it seems to work.
-}</span><span>
</span><span id="line-1072"></span><span>
</span><span id="line-1073"></span><span class="hs-comment">-- Soundness checks</span><span>
</span><span id="line-1074"></span><span class="hs-comment">--------------------</span><span>
</span><span id="line-1075"></span><span class="hs-comment">{-
This is not formalized anywhere, so hold to your seats!
RTTI in the presence of newtypes can be a tricky and unsound business.

Example:
~~~~~~~~~
Suppose we are doing RTTI for a partially evaluated
closure t, the real type of which is t :: MkT Int, for

   newtype MkT a = MkT [Maybe a]

The table below shows the results of RTTI and the improvement
calculated for different combinations of evaluatedness and :type t.
Regard the two first columns as input and the next two as output.

  # |     t     |  :type t  | rtti(t)  | improv.    | result
    ------------------------------------------------------------
  1 |     _     |    t b    |    a     | none       | OK
  2 |     _     |   MkT b   |    a     | none       | OK
  3 |     _     |   t Int   |    a     | none       | OK

  If t is not evaluated at *all*, we are safe.

  4 |  (_ : _)  |    t b    |   [a]    | t = []     | UNSOUND
  5 |  (_ : _)  |   MkT b   |  MkT a   | none       | OK (compensating for the missing newtype)
  6 |  (_ : _)  |   t Int   |  [Int]   | t = []     | UNSOUND

  If a is a minimal whnf, we run into trouble. Note that
  row 5 above does newtype enrichment on the ty_rtty parameter.

  7 | (Just _:_)|    t b    |[Maybe a] | t = [],    | UNSOUND
    |                       |          | b = Maybe a|

  8 | (Just _:_)|   MkT b   |  MkT a   |  none      | OK
  9 | (Just _:_)|   t Int   |   FAIL   |  none      | OK

  And if t is any more evaluated than whnf, we are still in trouble.
  Because constraints are solved in top-down order, when we reach the
  Maybe subterm what we got is already unsound. This explains why the
  row 9 fails to complete.

  10 | (Just _:_)|  t Int  | [Maybe a]   |  FAIL    | OK
  11 | (Just 1:_)|  t Int  | [Maybe Int] |  FAIL    | OK

  We can undo the failure in row 9 by leaving out the constraint
  coming from the type signature of t (i.e., the 2nd column).
  Note that this type information is still used
  to calculate the improvement. But we fail
  when trying to calculate the improvement, as there is no unifier for
  t Int = [Maybe a] or t Int = [Maybe Int].


  Another set of examples with t :: [MkT (Maybe Int)]  \equiv  [[Maybe (Maybe Int)]]

  # |     t     |    :type t    |  rtti(t)    | improvement | result
    ---------------------------------------------------------------------
  1 |(Just _:_) | [t (Maybe a)] | [[Maybe b]] | t = []      |
    |           |               |             | b = Maybe a |

The checks:
~~~~~~~~~~~
Consider a function obtainType that takes a value and a type and produces
the Term representation and a substitution (the improvement).
Assume an auxiliar rtti' function which does the actual job if recovering
the type, but which may produce a false type.

In pseudocode:

  rtti' :: a -&gt; IO Type  -- Does not use the static type information

  obtainType :: a -&gt; Type -&gt; IO (Maybe (Term, Improvement))
  obtainType v old_ty = do
       rtti_ty &lt;- rtti' v
       if monomorphic rtti_ty || (check rtti_ty old_ty)
        then ...
         else return Nothing
  where check rtti_ty old_ty = check1 rtti_ty &amp;&amp;
                              check2 rtti_ty old_ty

  check1 :: Type -&gt; Bool
  check2 :: Type -&gt; Type -&gt; Bool

Now, if rtti' returns a monomorphic type, we are safe.
If that is not the case, then we consider two conditions.


1. To prevent the class of unsoundness displayed by
   rows 4 and 7 in the example: no higher kind tyvars
   accepted.

  check1 (t a)   = NO
  check1 (t Int) = NO
  check1 ([] a)  = YES

2. To prevent the class of unsoundness shown by row 6,
   the rtti type should be structurally more
   defined than the old type we are comparing it to.
  check2 :: NewType -&gt; OldType -&gt; Bool
  check2 a  _        = True
  check2 [a] a       = True
  check2 [a] (t Int) = False
  check2 [a] (t a)   = False  -- By check1 we never reach this equation
  check2 [Int] a     = True
  check2 [Int] (t Int) = True
  check2 [Maybe a]   (t Int) = False
  check2 [Maybe Int] (t Int) = True
  check2 (Maybe [a])   (m [Int]) = False
  check2 (Maybe [Int]) (m [Int]) = True

-}</span><span>
</span><span id="line-1185"></span><span>
</span><span id="line-1186"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#check1"><span class="hs-identifier hs-type">check1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#QuantifiedType"><span class="hs-identifier hs-type">QuantifiedType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1187"></span><span id="check1"><span class="annot"><span class="annottext">check1 :: QuantifiedType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#check1"><span class="hs-identifier hs-var hs-var">check1</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681197010"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197010"><span class="hs-identifier hs-var">tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; Bool -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType -&gt; Bool) -&gt; [TcType] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#any"><span class="hs-identifier hs-var">any</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Bool
</span><a href="#local-6989586621681197008"><span class="hs-identifier hs-var">isHigherKind</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TyVar -&gt; TcType) -&gt; [TyVar] -&gt; [TcType]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar -&gt; TcType
</span><a href="GHC.Types.Var.html#tyVarKind"><span class="hs-identifier hs-var">tyVarKind</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681197010"><span class="hs-identifier hs-var">tvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1188"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1189"></span><span>   </span><span id="local-6989586621681197008"><span class="annot"><span class="annottext">isHigherKind :: TcType -&gt; Bool
</span><a href="#local-6989586621681197008"><span class="hs-identifier hs-var hs-var">isHigherKind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (TcType -&gt; Bool) -&gt; TcType -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoBinder] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoBinder] -&gt; Bool)
-&gt; (TcType -&gt; [TyCoBinder]) -&gt; TcType -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoBinder], TcType) -&gt; [TyCoBinder]
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">(([TyCoBinder], TcType) -&gt; [TyCoBinder])
-&gt; (TcType -&gt; ([TyCoBinder], TcType)) -&gt; TcType -&gt; [TyCoBinder]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; ([TyCoBinder], TcType)
</span><a href="GHC.Core.Type.html#splitPiTys"><span class="hs-identifier hs-var">splitPiTys</span></a></span><span>
</span><span id="line-1190"></span><span>
</span><span id="line-1191"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#check2"><span class="hs-identifier hs-type">check2</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#QuantifiedType"><span class="hs-identifier hs-type">QuantifiedType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#QuantifiedType"><span class="hs-identifier hs-type">QuantifiedType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1192"></span><span id="check2"><span class="annot"><span class="annottext">check2 :: QuantifiedType -&gt; QuantifiedType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#check2"><span class="hs-identifier hs-var hs-var">check2</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyVar]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197004"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197004"><span class="hs-identifier hs-var">rtti_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyVar]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197003"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197003"><span class="hs-identifier hs-var">old_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1193"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681197002"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197002"><span class="hs-identifier hs-var">rttis</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; TcType -&gt; Maybe (TyCon, [TcType])
TcType -&gt; Maybe (TyCon, [TcType])
</span><a href="GHC.Core.Type.html#tcSplitTyConApp_maybe"><span class="hs-identifier hs-var">tcSplitTyConApp_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197004"><span class="hs-identifier hs-var">rtti_ty</span></a></span><span>
</span><span id="line-1194"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1195"></span><span>      </span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681197001"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197001"><span class="hs-identifier hs-var">olds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; TcType -&gt; Maybe (TyCon, [TcType])
TcType -&gt; Maybe (TyCon, [TcType])
</span><a href="GHC.Core.Type.html#tcSplitTyConApp_maybe"><span class="hs-identifier hs-var">tcSplitTyConApp_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197003"><span class="hs-identifier hs-var">old_ty</span></a></span><span>
</span><span id="line-1196"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Bool] -&gt; Bool
forall (t :: * -&gt; *). Foldable t =&gt; t Bool -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#and"><span class="hs-identifier hs-var">and</span></a></span><span class="annot"><span class="annottext">([Bool] -&gt; Bool) -&gt; [Bool] -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(QuantifiedType -&gt; QuantifiedType -&gt; Bool)
-&gt; [QuantifiedType] -&gt; [QuantifiedType] -&gt; [Bool]
forall a b c. (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="../../base/src/GHC.List.html#zipWith"><span class="hs-identifier hs-var">zipWith</span></a></span><span> </span><span class="annot"><span class="annottext">QuantifiedType -&gt; QuantifiedType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#check2"><span class="hs-identifier hs-var">check2</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TcType -&gt; QuantifiedType) -&gt; [TcType] -&gt; [QuantifiedType]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; QuantifiedType
</span><a href="GHC.Runtime.Heap.Inspect.html#quantifyType"><span class="hs-identifier hs-var">quantifyType</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197002"><span class="hs-identifier hs-var">rttis</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TcType -&gt; QuantifiedType) -&gt; [TcType] -&gt; [QuantifiedType]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; QuantifiedType
</span><a href="GHC.Runtime.Heap.Inspect.html#quantifyType"><span class="hs-identifier hs-var">quantifyType</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681197001"><span class="hs-identifier hs-var">olds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1197"></span><span>      </span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType, TcType)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Maybe (TcType, TcType)
</span><a href="GHC.Core.Type.html#splitAppTy_maybe"><span class="hs-identifier hs-var">splitAppTy_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197003"><span class="hs-identifier hs-var">old_ty</span></a></span><span>
</span><span id="line-1198"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isMonomorphicOnNonPhantomArgs"><span class="hs-identifier hs-var">isMonomorphicOnNonPhantomArgs</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681197004"><span class="hs-identifier hs-var">rtti_ty</span></a></span><span>
</span><span id="line-1199"></span><span>      </span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1200"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1201"></span><span>
</span><span id="line-1202"></span><span class="hs-comment">-- Dealing with newtypes</span><span>
</span><span id="line-1203"></span><span class="hs-comment">--------------------------</span><span>
</span><span id="line-1204"></span><span class="hs-comment">{-
 congruenceNewtypes does a parallel fold over two Type values,
 compensating for missing newtypes on both sides.
 This is necessary because newtypes are not present
 in runtime, but sometimes there is evidence available.
   Evidence can come from DataCon signatures or
 from compile-time type inference.
 What we are doing here is an approximation
 of unification modulo a set of equations derived
 from newtype definitions. These equations should be the
 same as the equality coercions generated for newtypes
 in System Fc. The idea is to perform a sort of rewriting,
 taking those equations as rules, before launching unification.

 The caller must ensure the following.
 The 1st type (lhs) comes from the heap structure of ptrs,nptrs.
 The 2nd type (rhs) comes from a DataCon type signature.
 Rewriting (i.e. adding/removing a newtype wrapper) can happen
 in both types, but in the rhs it is restricted to the result type.

   Note that it is very tricky to make this 'rewriting'
 work with the unification implemented by TcM, where
 substitutions are operationally inlined. The order in which
 constraints are unified is vital as we cannot modify
 anything that has been touched by a previous unification step.
Therefore, congruenceNewtypes is sound only if the types
recovered by the RTTI mechanism are unified Top-Down.
-}</span><span>
</span><span id="line-1232"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#congruenceNewtypes"><span class="hs-identifier hs-type">congruenceNewtypes</span></a></span><span> </span><span class="hs-glyph">::</span><span>  </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1233"></span><span id="congruenceNewtypes"><span class="annot"><span class="annottext">congruenceNewtypes :: TcType -&gt; TcType -&gt; TR (TcType, TcType)
</span><a href="GHC.Runtime.Heap.Inspect.html#congruenceNewtypes"><span class="hs-identifier hs-var hs-var">congruenceNewtypes</span></a></span></span><span> </span><span id="local-6989586621681196997"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196997"><span class="hs-identifier hs-var">lhs</span></a></span></span><span> </span><span id="local-6989586621681196996"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196996"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TR TcType
</span><a href="#local-6989586621681196995"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196997"><span class="hs-identifier hs-var">lhs</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196996"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">TR TcType -&gt; (TcType -&gt; TR (TcType, TcType)) -&gt; TR (TcType, TcType)
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681196994"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196994"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(TcType, TcType) -&gt; TR (TcType, TcType)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196997"><span class="hs-identifier hs-var">lhs</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196994"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1234"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1235"></span><span>   </span><span id="local-6989586621681196995"><span class="annot"><span class="annottext">go :: TcType -&gt; TcType -&gt; TR TcType
</span><a href="#local-6989586621681196995"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621681196967"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196967"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681196966"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196966"><span class="hs-identifier hs-var">r</span></a></span></span><span>
</span><span id="line-1236"></span><span> </span><span class="hs-comment">-- TyVar lhs inductive case</span><span>
</span><span id="line-1237"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681196965"><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681196965"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Maybe TyVar
</span><a href="GHC.Core.Type.html#getTyVar_maybe"><span class="hs-identifier hs-var">getTyVar_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196967"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-1238"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyVar -&gt; Bool
</span><a href="GHC.Types.Var.html#isTcTyVar"><span class="hs-identifier hs-var">isTcTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681196965"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-1239"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyVar -&gt; Bool
</span><a href="GHC.Tc.Utils.TcType.html#isMetaTyVar"><span class="hs-identifier hs-var">isMetaTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681196965"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-1240"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TR TcType -&gt; TR TcType -&gt; TR TcType
forall a. TR a -&gt; TR a -&gt; TR a
</span><a href="GHC.Runtime.Heap.Inspect.html#recoverTR"><span class="hs-identifier hs-var">recoverTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196966"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TR TcType -&gt; TR TcType) -&gt; TR TcType -&gt; TR TcType
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1241"></span><span>         </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#Indirect"><span class="hs-identifier hs-type">Indirect</span></a></span><span> </span><span id="local-6989586621681196961"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196961"><span class="hs-identifier hs-var">ty_v</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyVar -&gt; TcM MetaDetails
</span><a href="GHC.Tc.Utils.TcMType.html#readMetaTyVar"><span class="hs-identifier hs-var">readMetaTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681196965"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-1242"></span><span>         </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; TR ()) -&gt; SDoc -&gt; TR ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#fsep"><span class="hs-identifier hs-var">fsep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;(congruence) Following indirect tyvar:&quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-1243"></span><span>                          </span><span class="annot"><span class="annottext">TyVar -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681196965"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#equals"><span class="hs-identifier hs-var">equals</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196961"><span class="hs-identifier hs-var">ty_v</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1244"></span><span>         </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TR TcType
</span><a href="#local-6989586621681196995"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196961"><span class="hs-identifier hs-var">ty_v</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196966"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-1245"></span><span class="hs-comment">-- FunTy inductive case</span><span>
</span><span id="line-1246"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681196959"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196959"><span class="hs-identifier hs-var">w1</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681196958"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196958"><span class="hs-identifier hs-var">l1</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681196957"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196957"><span class="hs-identifier hs-var">l2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Maybe (TcType, TcType, TcType)
</span><a href="GHC.Core.Type.html#splitFunTy_maybe"><span class="hs-identifier hs-var">splitFunTy_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196967"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-1247"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681196955"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196955"><span class="hs-identifier hs-var">w2</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681196954"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196954"><span class="hs-identifier hs-var">r1</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681196953"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196953"><span class="hs-identifier hs-var">r2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Maybe (TcType, TcType, TcType)
</span><a href="GHC.Core.Type.html#splitFunTy_maybe"><span class="hs-identifier hs-var">splitFunTy_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196966"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-1248"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196959"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-operator hs-var">`eqType`</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196955"><span class="hs-identifier hs-var">w2</span></a></span><span>
</span><span id="line-1249"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681196952"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196952"><span class="hs-identifier hs-var">r2'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TR TcType
</span><a href="#local-6989586621681196995"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196957"><span class="hs-identifier hs-var">l2</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196953"><span class="hs-identifier hs-var">r2</span></a></span><span>
</span><span id="line-1250"></span><span>         </span><span id="local-6989586621681196951"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196951"><span class="hs-identifier hs-var">r1'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TR TcType
</span><a href="#local-6989586621681196995"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196958"><span class="hs-identifier hs-var">l1</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196954"><span class="hs-identifier hs-var">r1</span></a></span><span>
</span><span id="line-1251"></span><span>         </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TcType -&gt; TcType
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTy"><span class="hs-identifier hs-var">mkVisFunTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196959"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196951"><span class="hs-identifier hs-var">r1'</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196952"><span class="hs-identifier hs-var">r2'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1252"></span><span class="hs-comment">-- TyconApp Inductive case; this is the interesting bit.</span><span>
</span><span id="line-1253"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681196949"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196949"><span class="hs-identifier hs-var">tycon_l</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; TcType -&gt; Maybe (TyCon, [TcType])
TcType -&gt; Maybe (TyCon, [TcType])
</span><a href="GHC.Core.Type.html#tcSplitTyConApp_maybe"><span class="hs-identifier hs-var">tcSplitTyConApp_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196997"><span class="hs-identifier hs-var">lhs</span></a></span><span>
</span><span id="line-1254"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681196948"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196948"><span class="hs-identifier hs-var">tycon_r</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; TcType -&gt; Maybe (TyCon, [TcType])
TcType -&gt; Maybe (TyCon, [TcType])
</span><a href="GHC.Core.Type.html#tcSplitTyConApp_maybe"><span class="hs-identifier hs-var">tcSplitTyConApp_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196996"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-1255"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196949"><span class="hs-identifier hs-var">tycon_l</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196948"><span class="hs-identifier hs-var">tycon_r</span></a></span><span>
</span><span id="line-1256"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TcType -&gt; TR TcType
</span><a href="#local-6989586621681196947"><span class="hs-identifier hs-var">upgrade</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196949"><span class="hs-identifier hs-var">tycon_l</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196966"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-1257"></span><span>
</span><span id="line-1258"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196966"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-1259"></span><span>
</span><span id="line-1260"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span class="annot"><a href="#local-6989586621681196947"><span class="hs-identifier hs-type">upgrade</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TR"><span class="hs-identifier hs-type">TR</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-1261"></span><span>          </span><span id="local-6989586621681196947"><span class="annot"><span class="annottext">upgrade :: TyCon -&gt; TcType -&gt; TR TcType
</span><a href="#local-6989586621681196947"><span class="hs-identifier hs-var hs-var">upgrade</span></a></span></span><span> </span><span id="local-6989586621681196946"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196946"><span class="hs-identifier hs-var">new_tycon</span></a></span></span><span> </span><span id="local-6989586621681196945"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196945"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-1262"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isNewTyCon"><span class="hs-identifier hs-var">isNewTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196946"><span class="hs-identifier hs-var">new_tycon</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1263"></span><span>              </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;(Upgrade) Not matching newtype evidence: &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-1264"></span><span>                       </span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196946"><span class="hs-identifier hs-var">new_tycon</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; for &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196945"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1265"></span><span>              </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196945"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1266"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1267"></span><span>               </span><span class="annot"><span class="annottext">SDoc -&gt; TR ()
</span><a href="GHC.Runtime.Heap.Inspect.html#traceTR"><span class="hs-identifier hs-var">traceTR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;(Upgrade) upgraded &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196945"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-1268"></span><span>                        </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; in presence of newtype evidence &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196946"><span class="hs-identifier hs-var">new_tycon</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1269"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TCvSubst
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681196944"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681196944"><span class="hs-identifier hs-var">vars</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; TR (TCvSubst, [TyVar])
</span><a href="GHC.Runtime.Heap.Inspect.html#instTyVars"><span class="hs-identifier hs-var">instTyVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; [TyVar]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var hs-var">tyConTyVars</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196946"><span class="hs-identifier hs-var">new_tycon</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1270"></span><span>               </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681196942"><span class="annot"><span class="annottext">ty' :: TcType
</span><a href="#local-6989586621681196942"><span class="hs-identifier hs-var hs-var">ty'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [TcType] -&gt; TcType
</span><a href="GHC.Core.TyCo.Rep.html#mkTyConApp"><span class="hs-identifier hs-var">mkTyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196946"><span class="hs-identifier hs-var">new_tycon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyVar] -&gt; [TcType]
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTys"><span class="hs-identifier hs-var">mkTyVarTys</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681196944"><span class="hs-identifier hs-var">vars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1271"></span><span>                   </span><span id="local-6989586621681196940"><span class="annot"><span class="annottext">rep_ty :: TcType
</span><a href="#local-6989586621681196940"><span class="hs-identifier hs-var hs-var">rep_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcType
</span><a href="GHC.Types.RepType.html#unwrapType"><span class="hs-identifier hs-var">unwrapType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196942"><span class="hs-identifier hs-var">ty'</span></a></span><span>
</span><span id="line-1272"></span><span>               </span><span class="annot"><span class="annottext">TcCoercionN
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM TcCoercionN -&gt; TcM TcCoercionN
forall a. TcM a -&gt; TcM a
</span><a href="GHC.Runtime.Heap.Inspect.html#liftTcM"><span class="hs-identifier hs-var">liftTcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe (HsExpr GhcRn) -&gt; TcType -&gt; TcType -&gt; TcM TcCoercionN
</span><a href="GHC.Tc.Utils.Unify.html#unifyType"><span class="hs-identifier hs-var">unifyType</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (HsExpr GhcRn)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196945"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196940"><span class="hs-identifier hs-var">rep_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1273"></span><span>        </span><span class="hs-comment">-- assumes that reptype doesn't ^^^^ touch tyconApp args</span><span>
</span><span id="line-1274"></span><span>               </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196942"><span class="hs-identifier hs-var">ty'</span></a></span><span>
</span><span id="line-1275"></span><span>
</span><span id="line-1276"></span><span>
</span><span id="line-1277"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#zonkTerm"><span class="hs-identifier hs-type">zonkTerm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span>
</span><span id="line-1278"></span><span id="zonkTerm"><span class="annot"><span class="annottext">zonkTerm :: Term -&gt; TR Term
</span><a href="GHC.Runtime.Heap.Inspect.html#zonkTerm"><span class="hs-identifier hs-var hs-var">zonkTerm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFoldM (IOEnv (Env TcGblEnv TcLclEnv)) Term -&gt; Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; TermFoldM m a -&gt; Term -&gt; m a
</span><a href="GHC.Runtime.Heap.Inspect.html#foldTermM"><span class="hs-identifier hs-var">foldTermM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TermFoldM :: forall (m :: * -&gt; *) a.
TermProcessor a (m a)
-&gt; (TcType -&gt; [Word] -&gt; m a)
-&gt; (ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; m a)
-&gt; (TcType -&gt; Either String DataCon -&gt; a -&gt; m a)
-&gt; (TcType -&gt; a -&gt; m a)
-&gt; TermFoldM m a
</span><a href="GHC.Runtime.Heap.Inspect.html#TermFoldM"><span class="hs-identifier hs-type">TermFoldM</span></a></span><span>
</span><span id="line-1279"></span><span>             </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fTermM :: TermProcessor Term (TR Term)
</span><a href="GHC.Runtime.Heap.Inspect.html#fTermM"><span class="hs-identifier hs-var">fTermM</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681196939"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196939"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681196938"><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681196938"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621681196937"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681196937"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681196936"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681196936"><span class="hs-identifier hs-var">tt</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#zonkRttiType"><span class="hs-identifier hs-var">zonkRttiType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196939"><span class="hs-identifier hs-var">ty</span></a></span><span>    </span><span class="annot"><span class="annottext">TR TcType -&gt; (TcType -&gt; TR Term) -&gt; TR Term
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681196935"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196935"><span class="hs-identifier hs-var">ty'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1280"></span><span>                                       </span><span class="annot"><span class="annottext">Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TermProcessor Term Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-var">Term</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196935"><span class="hs-identifier hs-var">ty'</span></a></span><span> </span><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681196938"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681196937"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681196936"><span class="hs-identifier hs-var">tt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1281"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fSuspensionM :: ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; TR Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fSuspensionM"><span class="hs-identifier hs-var">fSuspensionM</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681196934"><span class="annot"><span class="annottext">ClosureType
</span><a href="#local-6989586621681196934"><span class="hs-identifier hs-var">ct</span></a></span></span><span> </span><span id="local-6989586621681196933"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196933"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681196932"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681196932"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681196931"><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681196931"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#zonkRttiType"><span class="hs-identifier hs-var">zonkRttiType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196933"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">TR TcType -&gt; (TcType -&gt; TR Term) -&gt; TR Term
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681196930"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196930"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1282"></span><span>                                             </span><span class="annot"><span class="annottext">Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ClosureType -&gt; TcType -&gt; ForeignHValue -&gt; Maybe Name -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-var">Suspension</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureType
</span><a href="#local-6989586621681196934"><span class="hs-identifier hs-var">ct</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196930"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681196932"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681196931"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1283"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fNewtypeWrapM :: TcType -&gt; Either String DataCon -&gt; Term -&gt; TR Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fNewtypeWrapM"><span class="hs-identifier hs-var">fNewtypeWrapM</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681196929"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196929"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681196928"><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681196928"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621681196927"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681196927"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#zonkRttiType"><span class="hs-identifier hs-var">zonkRttiType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196929"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">TR TcType -&gt; (TcType -&gt; TR Term) -&gt; TR Term
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681196926"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196926"><span class="hs-identifier hs-var">ty'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1284"></span><span>                                           </span><span class="annot"><span class="annottext">Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span class="annot"><span class="annottext">(Term -&gt; TR Term) -&gt; Term -&gt; TR Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Either String DataCon -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#NewtypeWrap"><span class="hs-identifier hs-var">NewtypeWrap</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196926"><span class="hs-identifier hs-var">ty'</span></a></span><span> </span><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681196928"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681196927"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1285"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fRefWrapM :: TcType -&gt; Term -&gt; TR Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fRefWrapM"><span class="hs-identifier hs-var">fRefWrapM</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681196925"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196925"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681196924"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681196924"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(TcType -&gt; Term -&gt; Term)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (TcType -&gt; Term -&gt; Term)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#RefWrap"><span class="hs-identifier hs-var">RefWrap</span></a></span><span>  </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) (TcType -&gt; Term -&gt; Term)
-&gt; TR TcType -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Term -&gt; Term)
forall (m :: * -&gt; *) a b. Monad m =&gt; m (a -&gt; b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#ap"><span class="hs-operator hs-var">`ap`</span></a></span><span>
</span><span id="line-1286"></span><span>                                        </span><span class="annot"><span class="annottext">TcType -&gt; TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#zonkRttiType"><span class="hs-identifier hs-var">zonkRttiType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196925"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) (Term -&gt; Term) -&gt; TR Term -&gt; TR Term
forall (m :: * -&gt; *) a b. Monad m =&gt; m (a -&gt; b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#ap"><span class="hs-operator hs-var">`ap`</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681196924"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1287"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fPrimM :: TcType -&gt; [Word] -&gt; TR Term
</span><a href="GHC.Runtime.Heap.Inspect.html#fPrimM"><span class="hs-identifier hs-var">fPrimM</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Term -&gt; TR Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span class="annot"><span class="annottext">(Term -&gt; TR Term) -&gt; ([Word] -&gt; Term) -&gt; [Word] -&gt; TR Term
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(([Word] -&gt; Term) -&gt; [Word] -&gt; TR Term)
-&gt; (TcType -&gt; [Word] -&gt; Term) -&gt; TcType -&gt; [Word] -&gt; TR Term
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; [Word] -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-var">Prim</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1288"></span><span>
</span><span id="line-1289"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#zonkRttiType"><span class="hs-identifier hs-type">zonkRttiType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-1290"></span><span class="hs-comment">-- Zonk the type, replacing any unbound Meta tyvars</span><span>
</span><span id="line-1291"></span><span class="hs-comment">-- by RuntimeUnk skolems, safely out of Meta-tyvar-land</span><span>
</span><span id="line-1292"></span><span id="zonkRttiType"><span class="annot"><span class="annottext">zonkRttiType :: TcType -&gt; TR TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#zonkRttiType"><span class="hs-identifier hs-var hs-var">zonkRttiType</span></a></span></span><span> </span><span id="local-6989586621681196922"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196922"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681196921"><span class="annot"><span class="annottext">ZonkEnv
</span><a href="#local-6989586621681196921"><span class="hs-identifier hs-var">ze</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ZonkFlexi -&gt; TcM ZonkEnv
</span><a href="GHC.Tc.Utils.Zonk.html#mkEmptyZonkEnv"><span class="hs-identifier hs-var">mkEmptyZonkEnv</span></a></span><span> </span><span class="annot"><span class="annottext">ZonkFlexi
</span><a href="GHC.Tc.Utils.Zonk.html#RuntimeUnkFlexi"><span class="hs-identifier hs-var">RuntimeUnkFlexi</span></a></span><span>
</span><span id="line-1293"></span><span>                    </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">ZonkEnv -&gt; TcType -&gt; TR TcType
</span><a href="GHC.Tc.Utils.Zonk.html#zonkTcTypeToTypeX"><span class="hs-identifier hs-var">zonkTcTypeToTypeX</span></a></span><span> </span><span class="annot"><span class="annottext">ZonkEnv
</span><a href="#local-6989586621681196921"><span class="hs-identifier hs-var">ze</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196922"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1294"></span><span>
</span><span id="line-1295"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-1296"></span><span class="hs-comment">-- Restore Class predicates out of a representation type</span><span>
</span><span id="line-1297"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#dictsView"><span class="hs-identifier hs-type">dictsView</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-1298"></span><span id="dictsView"><span class="annot"><span class="annottext">dictsView :: TcType -&gt; TcType
</span><a href="GHC.Runtime.Heap.Inspect.html#dictsView"><span class="hs-identifier hs-var hs-var">dictsView</span></a></span></span><span> </span><span id="local-6989586621681196920"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196920"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196920"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1299"></span><span>
</span><span id="line-1300"></span><span>
</span><span id="line-1301"></span><span class="hs-comment">-- Use only for RTTI types</span><span>
</span><span id="line-1302"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#isMonomorphic"><span class="hs-identifier hs-type">isMonomorphic</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1303"></span><span id="isMonomorphic"><span class="annot"><span class="annottext">isMonomorphic :: TcType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isMonomorphic"><span class="hs-identifier hs-var hs-var">isMonomorphic</span></a></span></span><span> </span><span id="local-6989586621681196919"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196919"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681196918"><span class="hs-identifier hs-var">noExistentials</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681196917"><span class="hs-identifier hs-var">noUniversals</span></a></span><span>
</span><span id="line-1304"></span><span> </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681196916"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681196916"><span class="hs-identifier hs-var">tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681196915"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196915"><span class="hs-identifier hs-var">ty'</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; ([TyVar], [TcType], TcType)
</span><a href="GHC.Tc.Utils.TcType.html#tcSplitSigmaTy"><span class="hs-identifier hs-var">tcSplitSigmaTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196919"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1305"></span><span>       </span><span id="local-6989586621681196918"><span class="annot"><span class="annottext">noExistentials :: Bool
</span><a href="#local-6989586621681196918"><span class="hs-identifier hs-var hs-var">noExistentials</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Bool
</span><a href="GHC.Core.TyCo.FVs.html#noFreeVarsOfType"><span class="hs-identifier hs-var">noFreeVarsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196915"><span class="hs-identifier hs-var">ty'</span></a></span><span>
</span><span id="line-1306"></span><span>       </span><span id="local-6989586621681196917"><span class="annot"><span class="annottext">noUniversals :: Bool
</span><a href="#local-6989586621681196917"><span class="hs-identifier hs-var hs-var">noUniversals</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681196916"><span class="hs-identifier hs-var">tvs</span></a></span><span>
</span><span id="line-1307"></span><span>
</span><span id="line-1308"></span><span class="hs-comment">-- Use only for RTTI types</span><span>
</span><span id="line-1309"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#isMonomorphicOnNonPhantomArgs"><span class="hs-identifier hs-type">isMonomorphicOnNonPhantomArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#RttiType"><span class="hs-identifier hs-type">RttiType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1310"></span><span id="isMonomorphicOnNonPhantomArgs"><span class="annot"><span class="annottext">isMonomorphicOnNonPhantomArgs :: TcType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isMonomorphicOnNonPhantomArgs"><span class="hs-identifier hs-var hs-var">isMonomorphicOnNonPhantomArgs</span></a></span></span><span> </span><span id="local-6989586621681196911"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196911"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-1311"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681196910"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196910"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681196909"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681196909"><span class="hs-identifier hs-var">all_args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; TcType -&gt; Maybe (TyCon, [TcType])
TcType -&gt; Maybe (TyCon, [TcType])
</span><a href="GHC.Core.Type.html#tcSplitTyConApp_maybe"><span class="hs-identifier hs-var">tcSplitTyConApp_maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TcType
</span><a href="GHC.Types.RepType.html#unwrapType"><span class="hs-identifier hs-var">unwrapType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196911"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1312"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="local-6989586621681196908"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681196908"><span class="hs-identifier hs-var">phantom_vars</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [TyVar]
</span><a href="GHC.Runtime.Heap.Inspect.html#tyConPhantomTyVars"><span class="hs-identifier hs-var">tyConPhantomTyVars</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196910"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-1313"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="local-6989586621681196906"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681196906"><span class="hs-identifier hs-var">concrete_args</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196905"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681196904"><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681196904"><span class="hs-identifier hs-var">tyv</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681196905"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196905"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [TyVar]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var hs-var">tyConTyVars</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196910"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; [TcType] -&gt; [(TyVar, TcType)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681196909"><span class="hs-identifier hs-var">all_args</span></a></span><span>
</span><span id="line-1314"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621681196904"><span class="hs-identifier hs-var">tyv</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar -&gt; [TyVar] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#notElem"><span class="hs-operator hs-var">`notElem`</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681196908"><span class="hs-identifier hs-var">phantom_vars</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1315"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TcType -&gt; Bool) -&gt; [TcType] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isMonomorphicOnNonPhantomArgs"><span class="hs-identifier hs-var">isMonomorphicOnNonPhantomArgs</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681196906"><span class="hs-identifier hs-var">concrete_args</span></a></span><span>
</span><span id="line-1316"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681196902"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196902"><span class="hs-identifier hs-var">ty1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681196901"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196901"><span class="hs-identifier hs-var">ty2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Maybe (TcType, TcType, TcType)
</span><a href="GHC.Core.Type.html#splitFunTy_maybe"><span class="hs-identifier hs-var">splitFunTy_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196911"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1317"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TcType -&gt; Bool) -&gt; [TcType] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isMonomorphicOnNonPhantomArgs"><span class="hs-identifier hs-var">isMonomorphicOnNonPhantomArgs</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196902"><span class="hs-identifier hs-var">ty1</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196901"><span class="hs-identifier hs-var">ty2</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1318"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isMonomorphic"><span class="hs-identifier hs-var">isMonomorphic</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196911"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1319"></span><span>
</span><span id="line-1320"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#tyConPhantomTyVars"><span class="hs-identifier hs-type">tyConPhantomTyVars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1321"></span><span id="tyConPhantomTyVars"><span class="annot"><span class="annottext">tyConPhantomTyVars :: TyCon -&gt; [TyVar]
</span><a href="GHC.Runtime.Heap.Inspect.html#tyConPhantomTyVars"><span class="hs-identifier hs-var hs-var">tyConPhantomTyVars</span></a></span></span><span> </span><span id="local-6989586621681196900"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196900"><span class="hs-identifier hs-var">tc</span></a></span></span><span>
</span><span id="line-1322"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isAlgTyCon"><span class="hs-identifier hs-var">isAlgTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196900"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-1323"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681196898"><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621681196898"><span class="hs-identifier hs-var">dcs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Maybe [DataCon]
</span><a href="GHC.Core.TyCon.html#tyConDataCons_maybe"><span class="hs-identifier hs-var">tyConDataCons_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196900"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-1324"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="local-6989586621681196896"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681196896"><span class="hs-identifier hs-var">dc_vars</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(DataCon -&gt; [TyVar]) -&gt; [DataCon] -&gt; [TyVar]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [TyVar]
</span><a href="GHC.Core.DataCon.html#dataConUnivTyVars"><span class="hs-identifier hs-var">dataConUnivTyVars</span></a></span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621681196898"><span class="hs-identifier hs-var">dcs</span></a></span><span>
</span><span id="line-1325"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [TyVar]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var hs-var">tyConTyVars</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681196900"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; [TyVar] -&gt; [TyVar]
forall a. Eq a =&gt; [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#%5C%5C"><span class="hs-operator hs-var">\\</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681196896"><span class="hs-identifier hs-var">dc_vars</span></a></span><span>
</span><span id="line-1326"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#tyConPhantomTyVars"><span class="hs-identifier hs-var">tyConPhantomTyVars</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1327"></span><span>
</span><span id="line-1328"></span><span class="hs-keyword">type</span><span> </span><span id="QuantifiedType"><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#QuantifiedType"><span class="hs-identifier hs-var">QuantifiedType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1329"></span><span>   </span><span class="hs-comment">-- Make the free type variables explicit</span><span>
</span><span id="line-1330"></span><span>   </span><span class="hs-comment">-- The returned Type should have no top-level foralls (I believe)</span><span>
</span><span id="line-1331"></span><span>
</span><span id="line-1332"></span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#quantifyType"><span class="hs-identifier hs-type">quantifyType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#QuantifiedType"><span class="hs-identifier hs-type">QuantifiedType</span></a></span><span>
</span><span id="line-1333"></span><span class="hs-comment">-- Generalize the type: find all free and forall'd tyvars</span><span>
</span><span id="line-1334"></span><span class="hs-comment">-- and return them, together with the type inside, which</span><span>
</span><span id="line-1335"></span><span class="hs-comment">-- should not be a forall type.</span><span>
</span><span id="line-1336"></span><span class="hs-comment">--</span><span>
</span><span id="line-1337"></span><span class="hs-comment">-- Thus (quantifyType (forall a. a-&gt;[b]))</span><span>
</span><span id="line-1338"></span><span class="hs-comment">-- returns ([a,b], a -&gt; [b])</span><span>
</span><span id="line-1339"></span><span>
</span><span id="line-1340"></span><span id="quantifyType"><span class="annot"><span class="annottext">quantifyType :: TcType -&gt; QuantifiedType
</span><a href="GHC.Runtime.Heap.Inspect.html#quantifyType"><span class="hs-identifier hs-var hs-var">quantifyType</span></a></span></span><span> </span><span id="local-6989586621681196893"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196893"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">(TyVar -&gt; Bool) -&gt; [TyVar] -&gt; [TyVar]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar -&gt; Bool
</span><a href="GHC.Types.Var.html#isTyVar"><span class="hs-identifier hs-var">isTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">([TyVar] -&gt; [TyVar]) -&gt; [TyVar] -&gt; [TyVar]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1341"></span><span>                    </span><span class="annot"><span class="annottext">TcType -&gt; [TyVar]
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypeWellScoped"><span class="hs-identifier hs-var">tyCoVarsOfTypeWellScoped</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196891"><span class="hs-identifier hs-var">rho</span></a></span><span>
</span><span id="line-1342"></span><span>                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196891"><span class="hs-identifier hs-var">rho</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1343"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1344"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681196890"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621681196890"><span class="hs-identifier hs-var">_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681196891"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196891"><span class="hs-identifier hs-var">rho</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; QuantifiedType
</span><a href="GHC.Tc.Utils.TcType.html#tcSplitForAllTys"><span class="hs-identifier hs-var">tcSplitForAllTys</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681196893"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1345"></span></pre></body></html>